|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mockrunner.struts.DefaultExceptionHandlerConfig
public class DefaultExceptionHandlerConfig
The default implementation of ExceptionHandlerConfig
. It uses the Struts
exception handling mechanism. Use the various constructors to provide your subclass
of ExceptionHandler
or to configure exception handling using an
instance of ExceptionConfig
. The ExceptionConfig
class
allows you to set the handler class an exception type.
Use ActionTestModule.addExceptionHandler(com.mockrunner.struts.ExceptionHandlerConfig)
to register an exception handler.
Constructor Summary | |
---|---|
DefaultExceptionHandlerConfig(java.lang.Class exceptionClass)
|
|
DefaultExceptionHandlerConfig(org.apache.struts.config.ExceptionConfig exceptionConfig)
|
|
DefaultExceptionHandlerConfig(org.apache.struts.action.ExceptionHandler exceptionHandler,
java.lang.Class exceptionClass)
|
|
DefaultExceptionHandlerConfig(org.apache.struts.action.ExceptionHandler exceptionHandler,
org.apache.struts.config.ExceptionConfig exceptionConfig)
|
Method Summary | |
---|---|
boolean |
canHandle(java.lang.Exception exception)
Returns if this handler is able to handle the exception. |
org.apache.struts.config.ExceptionConfig |
getExceptionConfig()
Get the underlying ExceptionConfig . |
org.apache.struts.action.ExceptionHandler |
getExceptionHandler()
Get the underlying ExceptionHandler . |
java.lang.Object |
handle(java.lang.Exception exception,
org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the exception. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultExceptionHandlerConfig(org.apache.struts.config.ExceptionConfig exceptionConfig)
public DefaultExceptionHandlerConfig(org.apache.struts.action.ExceptionHandler exceptionHandler, org.apache.struts.config.ExceptionConfig exceptionConfig)
public DefaultExceptionHandlerConfig(org.apache.struts.action.ExceptionHandler exceptionHandler, java.lang.Class exceptionClass)
public DefaultExceptionHandlerConfig(java.lang.Class exceptionClass)
Method Detail |
---|
public boolean canHandle(java.lang.Exception exception)
ExceptionHandlerConfig
canHandle
in interface ExceptionHandlerConfig
true
if this handler is able to handle the exception,
false
otherwisepublic java.lang.Object handle(java.lang.Exception exception, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
ExceptionHandlerConfig
handle
in interface ExceptionHandlerConfig
exception
- the exceptionmapping
- the current ActionMapping
form
- the current ActionForm
request
- the current requestresponse
- the current response
ActionForward
,
but may be any object
javax.servlet.ServletException
public org.apache.struts.config.ExceptionConfig getExceptionConfig()
ExceptionConfig
. If you did not provide
an instance of ExceptionConfig
, this class will create one
internally.
ExceptionConfig
public org.apache.struts.action.ExceptionHandler getExceptionHandler()
ExceptionHandler
.
ExceptionHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |