You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ni...@apache.org on 2004/09/07 04:52:18 UTC
cvs commit: jakarta-struts/src/share/org/apache/struts/action Action.java
niallp 2004/09/06 19:52:18
Modified: src/share/org/apache/struts/action Action.java
Log:
Bug 31060 Change ActionErrors to ActionMessages - patch by Sven Rottenbiller and Alwin Ibba
Revision Changes Path
1.77 +13 -13 jakarta-struts/src/share/org/apache/struts/action/Action.java
Index: Action.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/Action.java,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- Action.java 26 Jun 2004 00:36:22 -0000 1.76
+++ Action.java 7 Sep 2004 02:52:18 -0000 1.77
@@ -255,7 +255,7 @@
*/
protected void addErrors(
HttpServletRequest request,
- ActionErrors errors) {
+ ActionMessages errors) {
if (errors == null){
// bad programmer! *slap*
@@ -263,9 +263,9 @@
}
// get any existing errors from the request, or make a new one
- ActionErrors requestErrors = (ActionErrors) request.getAttribute(Globals.ERROR_KEY);
+ ActionMessages requestErrors = (ActionMessages)request.getAttribute(Globals.ERROR_KEY);
if (requestErrors == null){
- requestErrors = new ActionErrors();
+ requestErrors = new ActionMessages();
}
// add incoming errors
requestErrors.add(errors);
@@ -330,18 +330,18 @@
/**
* Retrieves any existing errors placed in the request by previous actions. This method could be called instead
- * of creating a <code>new ActionErrors()<code> at the beginning of an <code>Action<code>
+ * of creating a <code>new ActionMessages()<code> at the beginning of an <code>Action<code>
* This will prevent saveErrors() from wiping out any existing Errors
*
- * @return the Errors that already exist in the request, or a new ActionErrors object if empty.
+ * @return the Errors that already exist in the request, or a new ActionMessages object if empty.
* @param request The servlet request we are processing
* @since Struts 1.2.1
*/
- protected ActionErrors getErrors(HttpServletRequest request) {
- ActionErrors errors =
- (ActionErrors) request.getAttribute(Globals.ERROR_KEY);
+ protected ActionMessages getErrors(HttpServletRequest request) {
+ ActionMessages errors =
+ (ActionMessages) request.getAttribute(Globals.ERROR_KEY);
if (errors == null) {
- errors = new ActionErrors();
+ errors = new ActionMessages();
}
return errors;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org