dgraham 2003/08/23 10:11:46
Modified: src/share/org/apache/struts/action ExceptionHandler.java
Log:
Use ActionMessages instead of ActionErrors.
Revision Changes Path
1.22 +16 -15
jakarta-struts/src/share/org/apache/struts/action/ExceptionHandler.java
Index: ExceptionHandler.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ExceptionHandler.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ExceptionHandler.java 16 Aug 2003 17:50:10 -0000 1.21
+++ ExceptionHandler.java 23 Aug 2003 17:11:46 -0000 1.22
@@ -108,16 +108,17 @@
*
* @since Struts 1.1
*/
- public ActionForward execute(Exception ex,
- ExceptionConfig ae,
- ActionMapping mapping,
- ActionForm formInstance,
- HttpServletRequest request,
- HttpServletResponse response)
+ public ActionForward execute(
+ Exception ex,
+ ExceptionConfig ae,
+ ActionMapping mapping,
+ ActionForm formInstance,
+ HttpServletRequest request,
+ HttpServletResponse response)
throws ServletException {
ActionForward forward = null;
- ActionError error = null;
+ ActionMessage error = null;
String property = null;
// Build the forward from the exception mapping if it exists
@@ -130,10 +131,10 @@
// Figure out the error
if (ex instanceof ModuleException) {
- error = ((ModuleException) ex).getError();
+ error = ((ModuleException) ex).getActionMessage();
property = ((ModuleException) ex).getProperty();
} else {
- error = new ActionError(ae.getKey(), ex.getMessage());
+ error = new ActionMessage(ae.getKey(), ex.getMessage());
property = error.getKey();
}
@@ -141,7 +142,7 @@
// Store the exception
request.setAttribute(Globals.EXCEPTION_KEY, ex);
- storeException(request, property, error, forward, ae.getScope());
+ this.storeException(request, property, error, forward, ae.getScope());
return forward;
}
@@ -186,7 +187,7 @@
* from an Exception during <b>Action</b> delegation. The default
* implementation is to set an attribute of the request or session, as
* defined by the scope provided (the scope from the exception mapping). An
- * <b>ActionErrors</b> instance is created, the error is added to the
+ * <b>ActionMessages</b> instance is created, the error is added to the
* collection and the collection is set under the Globals.ERROR_KEY.
*
* @param request - The request we are handling
@@ -203,7 +204,7 @@
ActionForward forward,
String scope) {
- ActionErrors errors = new ActionErrors();
+ ActionMessages errors = new ActionMessages();
errors.add(property, error);
if ("request".equals(scope)) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]