|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.makumba.commons.ControllerHandler
org.makumba.devel.ErrorControllerHandler
public class ErrorControllerHandler
This handler lets the request go to the filter chain and then catches all kind of exceptions after it. The exceptions
are then handled by the ErrorFormatter
. It should be the first one of the filter handlers. If disabled, the
"raw" exception is thrown. TODO the login should not be triggered directly in here, but somewhere else
Field Summary | |
---|---|
static String |
ORIGINAL_REQUEST
|
Constructor Summary | |
---|---|
ErrorControllerHandler()
|
Method Summary | |
---|---|
boolean |
beforeFilter(ServletRequest request,
ServletResponse response,
FilterConfig conf,
ServletObjects httpServletObjects)
Performs an operation before the doFilterChain() method is called |
static String |
getLoginPage(HttpServletRequest req,
String servletPath)
Computes the login page from a servletPath |
static String |
getPage(HttpServletRequest req,
String servletPath,
String pageName)
Computes any page from a servletPath, used to compute login, error or any other default page |
protected static boolean |
login(HttpServletRequest req,
HttpServletResponse resp)
Finds the closest login.jsp and forwards to it |
boolean |
onError(ServletRequest request,
ServletResponse response,
Throwable e,
FilterConfig conf)
Performs an operation when an error occurs |
void |
setWasException(HttpServletRequest req)
Signals that there was an exception during the request, so some operations can be skipped |
void |
treatException(Throwable t,
HttpServletRequest req,
HttpServletResponse resp,
FilterConfig conf)
Treats an exception that occurred during the request. |
boolean |
wasException(HttpServletRequest req)
Tests if there was an exception during the request |
Methods inherited from class org.makumba.commons.ControllerHandler |
---|
afterBeforeFilter, afterFilter, finalize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ORIGINAL_REQUEST
Constructor Detail |
---|
public ErrorControllerHandler()
Method Detail |
---|
public boolean beforeFilter(ServletRequest request, ServletResponse response, FilterConfig conf, ServletObjects httpServletObjects)
ControllerHandler
beforeFilter
in class ControllerHandler
true
if the operation worked out successfully, false
otherwisepublic boolean onError(ServletRequest request, ServletResponse response, Throwable e, FilterConfig conf)
ControllerHandler
onError
in class ControllerHandler
true
if this still is an error, false
if it was handledpublic void treatException(Throwable t, HttpServletRequest req, HttpServletResponse resp, FilterConfig conf)
t
- the Throwable corresponding to the exceptionreq
- the http request corresponding to the accessresp
- the http response corresponding to the accesspublic static String getLoginPage(HttpServletRequest req, String servletPath)
req
- the http request corresponding to the current accessservletPath
- the path of the servlet we are in
public static String getPage(HttpServletRequest req, String servletPath, String pageName)
req
- the http request corresponding to the current accessservletPath
- the path of the servlet we are inpageName
- the name of the page we are looking for
protected static boolean login(HttpServletRequest req, HttpServletResponse resp)
req
- the http request corresponding to the current accessresp
- the http response corresponding to the current accesspublic void setWasException(HttpServletRequest req)
req
- the http request corresponding to the current accesspublic boolean wasException(HttpServletRequest req)
req
- the http request corresponding to the current access
true
if there was an exception, false
otherwise
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |