public interface ActionExceptionHandler extends Module
An interface for handlers that can take care of ActionExceptions thrown when handling an HTTP request. By including a module that implements this interface, GenericContext will automatically use it whenever an ActionException inside it occurs. Note that the root servlet does not (necessarily) perform similarly. If you want to include custom ActionException handling, you should use a context for all your actions. GenericContext can be used as is for this purpose.
See TemplateActionExceptionHandler for a generic implementation of this using templates.
Implementations of this should not extends AbstractAction, or if they do, they need to take special care about dependency handling. The reason is that this will easily cause a circular dependency. AbstractAction will require a ServletModule. ServletModules, which GenericContext implements, may then optionally require an ActionExceptionHandler. If that is an AbstractAction, it will again look for a ServletModule and so on. So if you do extend AbstractAction, you will need to override getDependencies to break the circular dependency problem.
Modifier and Type | Method and Description |
---|---|
boolean |
handleActionException(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
ModulesServlet.HttpMethod method,
User user,
ActionException ae)
Handles an exception that occurred when handling an HTTP request.
|
getDependencies, init, isInitialized, isRunning, start, stop
boolean handleActionException(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, ModulesServlet.HttpMethod method, User user, ActionException ae) throws javax.servlet.ServletException, java.io.IOException, ActionException
req
- The HTTP request.resp
- The HTTP request where the response can be written.method
- The HTTP method used with the request.user
- The authenticated user, or null if not applicable.ae
- The ActionException that caused this to be called.javax.servlet.ServletException
java.io.IOException
ActionException
Copyright 2004-2015 Wandora Team