Default ExceptionHandler implementation that makes it easy for users to extend and add custom handling for different types of exception. When extending this class methods can be added that meet the following requirements:
When an exception is caught the exception handler attempts to find a method that can handle that type of exception. If none is found the exception's super-types are iterated through and methods looked for which match the super-types. If a matching method is found it will be invoked. Otherwise the exception will simply be rethrown by the exception handler - though first it will be wrapped in a StripesServletException if necessary in order to make it acceptable to the container.
The following are examples of method signatures that might be added by subclasses:
public Resolution handle(FileUploadLimitExceededException ex, HttpServletRequest req, HttpServletResponse resp) { ... } public void handle(MySecurityException ex, HttpServletRequest req, HttpServletResponse resp) { ... } public void catchAll(Throwable t, HttpServletRequest req, HttpServletResponse resp) { ... }@author Tim Fennell @since Stripes 1.3
|
|
|
|