|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.struts.action.ExceptionHandler
jp.terasoluna.fw.web.struts.action.DefaultExceptionHandler
public class DefaultExceptionHandler
General exception handler which outputs the log at a specified log level.
When exception occurs, it outputs the log and navigates to the error screen.
To use this function, specify DefaultExceptionHandler as a class of global exception or action level
exception handler.
When the transition path is not specified in the "path" attribute of <exception> element, "input" attribute of action mapping is considered as a forward resource.
Exception instance which is occurred, is stored in the request under Globals.EXCEPTION_KEY key.
ExceptionHandler,
ExceptionConfigEx,
SystemExceptionHandler,
Globals| Field Summary | |
|---|---|
protected static java.lang.String |
LOG_LEVEL_DEBUG
Log level(DEBUG) |
protected static java.lang.String |
LOG_LEVEL_ERROR
Log level(ERROR) |
protected static java.lang.String |
LOG_LEVEL_FATAL
Log level(FATAL) |
protected static java.lang.String |
LOG_LEVEL_INFO
Log level(INFO) |
protected static java.lang.String |
LOG_LEVEL_TRACE
Log level(TRACE) |
protected static java.lang.String |
LOG_LEVEL_WARN
Log level(WARN) |
private static org.apache.commons.logging.Log |
logger
Log instance |
private static org.apache.struts.util.MessageResources |
messages
Message resource |
| Constructor Summary | |
|---|---|
DefaultExceptionHandler()
|
|
| Method Summary | |
|---|---|
org.apache.struts.action.ActionForward |
execute(java.lang.Exception ex,
org.apache.struts.config.ExceptionConfig eConfig,
org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm formInstance,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Performs exception handling. |
protected org.apache.commons.logging.Log |
getLogger()
Fetches logger of handler. |
protected void |
logException(java.lang.Exception e)
Outputs the log exception. |
protected void |
logException(java.lang.Exception e,
java.lang.String logLevel)
Outputs the log exception. |
protected void |
logException(java.lang.Exception e,
java.lang.String logLevel,
java.lang.String message)
Outputs the log exception. |
protected void |
logException(java.lang.String logLevel,
java.lang.String message)
Outputs the log exception. |
| Methods inherited from class org.apache.struts.action.ExceptionHandler |
|---|
storeException, storeException |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.apache.commons.logging.Log logger
protected static final java.lang.String LOG_LEVEL_TRACE
protected static final java.lang.String LOG_LEVEL_DEBUG
protected static final java.lang.String LOG_LEVEL_INFO
protected static final java.lang.String LOG_LEVEL_WARN
protected static final java.lang.String LOG_LEVEL_ERROR
protected static final java.lang.String LOG_LEVEL_FATAL
private static org.apache.struts.util.MessageResources messages
| Constructor Detail |
|---|
public DefaultExceptionHandler()
| Method Detail |
|---|
public org.apache.struts.action.ActionForward execute(java.lang.Exception ex,
org.apache.struts.config.ExceptionConfig eConfig,
org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm formInstance,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException
Performs exception handling.
execute in class org.apache.struts.action.ExceptionHandlerex - ExceptioneConfig - Exception configurationmapping - Action mappingformInstance - Action formrequest - HTTP request response - HTTP response
javax.servlet.ServletException - Servlet exceptionExceptionHandler.execute(
java.lang.Exception,
org.apache.struts.config.ExceptionConfig,
org.apache.struts.action.ActionMapping,
org.apache.struts.action.ActionForm,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse
)
protected void logException(java.lang.Exception e,
java.lang.String logLevel)
e - Exception which is occurredlogLevel - Log level
protected void logException(java.lang.String logLevel,
java.lang.String message)
logLevel - Log levelmessage - Message to be output
protected void logException(java.lang.Exception e,
java.lang.String logLevel,
java.lang.String message)
e - Exception which is occurredlogLevel - Log levelmessage - Message to be outputprotected void logException(java.lang.Exception e)
*It is not output here
logException in class org.apache.struts.action.ExceptionHandlere - Exception which is occurredExceptionHandler.logException(
java.lang.Exception)protected org.apache.commons.logging.Log getLogger()
For implementing own exception handler by extending this class, override this method in subclass and return the logger.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||