net.sourceforge.stripes.exception
Interface ExceptionHandler

All Superinterfaces:
ConfigurableComponent
All Known Implementing Classes:
DefaultExceptionHandler, DelegatingExceptionHandler

public interface ExceptionHandler
extends ConfigurableComponent

Component that is delegated to in order to handle any exceptions that are raised during the processing of a request which is processed through the Stripes Filter. Implementations have two options for handling an exception:

In the first case it is up to the exception handler to provide an appropriate response to the user. This might involve forwarding or redirecting the user to an error page, or providing a streaming response in the case of an AJAX client.

If the ExceptionHandler elects not to handle an Exception and re-throws it then the exception will percolate up and the container will handle it using whatever error pages are configured.

Since:
Stripes 1.3
Author:
Tim Fennell

Method Summary
 void handle(Throwable throwable, HttpServletRequest request, HttpServletResponse response)
          Responsible for handling any exceptions that arise as described in the class level javadoc.
 
Methods inherited from interface net.sourceforge.stripes.config.ConfigurableComponent
init
 

Method Detail

handle

void handle(Throwable throwable,
            HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException,
                   IOException
Responsible for handling any exceptions that arise as described in the class level javadoc.

Parameters:
throwable - the exception/throwable being handled
request - the current request. Notably, if the request progressed as far as ActionBeanResolution the ActionBean can be retreived by calling request.getAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN).
response - the current response.
Throws:
ServletException - if the exception passed in cannot be handled
IOException


? Copyright 2005-2006, Stripes Development Team.