|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.struts.action.ExceptionHandler
An ExceptionHandler is configured in the Struts
configuration file to handle a specific type of exception thrown
by an Action.execute
method.
Field Summary | |
private static org.apache.commons.logging.Log |
log
Commons logging instance. |
private static MessageResources |
messages
The message resources for this package. |
Constructor Summary | |
ExceptionHandler()
|
Method Summary | |
ActionForward |
execute(java.lang.Exception ex,
ExceptionConfig ae,
ActionMapping mapping,
ActionForm formInstance,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle the Exception . |
protected void |
logException(java.lang.Exception e)
Logs the Exception using commons-logging. |
protected void |
storeException(javax.servlet.http.HttpServletRequest request,
java.lang.String property,
ActionError error,
ActionForward forward,
java.lang.String scope)
Deprecated. Use storeException(HttpServletRequest, String, ActionMessage, ActionForward, String) instead. This will be removed after Struts 1.2. |
protected void |
storeException(javax.servlet.http.HttpServletRequest request,
java.lang.String property,
ActionMessage error,
ActionForward forward,
java.lang.String scope)
Default implementation for handling an ActionMessage generated
from an Exception during Action delegation. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final org.apache.commons.logging.Log log
Commons logging instance.
private static MessageResources messages
The message resources for this package.
Constructor Detail |
public ExceptionHandler()
Method Detail |
public ActionForward execute(java.lang.Exception ex, ExceptionConfig ae, ActionMapping mapping, ActionForm formInstance, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
Handle the Exception
.
Return the ActionForward
instance (if any) returned by
the called ExceptionHandler
.
ex
- The exception to handleae
- The ExceptionConfig corresponding to the exceptionmapping
- The ActionMapping we are processingformInstance
- The ActionForm we are processingrequest
- The servlet request we are processingresponse
- The servlet response we are creatingjavax.servlet.ServletException
- if a servlet exception occursprotected void logException(java.lang.Exception e)
Logs the Exception
using commons-logging.
e
- The Exception to log.protected void storeException(javax.servlet.http.HttpServletRequest request, java.lang.String property, ActionError error, ActionForward forward, java.lang.String scope)
Default implementation for handling an ActionError
generated
from an Exception
during Action
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
ActionErrors
instance is created, the error is added to the collection
and the collection is set under the Globals.ERROR_KEY
.
request
- The request we are handlingproperty
- The property name to use for this errorerror
- The error generated from the exception mappingforward
- The forward generated from the input path (from the form or exception mapping)scope
- The scope of the exception mapping.protected void storeException(javax.servlet.http.HttpServletRequest request, java.lang.String property, ActionMessage error, ActionForward forward, java.lang.String scope)
Default implementation for handling an ActionMessage
generated
from an Exception
during Action
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
ActionMessages
instance is created, the error is added to the
collection and the collection is set under the Globals.ERROR_KEY
.
request
- The request we are handlingproperty
- The property name to use for this errorerror
- The error generated from the exception mappingforward
- The forward generated from the input path (from the form or exception mapping)scope
- The scope of the exception mapping.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |