org.loom.exception
Class DefaultExceptionHandler

java.lang.Object
  extended by org.loom.exception.DefaultExceptionHandler
All Implemented Interfaces:
ExceptionHandler

@Singleton
public class DefaultExceptionHandler
extends java.lang.Object
implements ExceptionHandler

Forwards all returned exceptions to the error 500 page


Constructor Summary
DefaultExceptionHandler()
           
 
Method Summary
 void handle(LoomServletRequest request, LoomServletResponse response, java.lang.Throwable exception)
           
 void redirectWithErrors(LoomServletRequest request, LoomServletResponse response)
          Redirect to the source form page (extracted using the REFERER header).
 void setRethrowExceptions(java.util.Set<java.lang.Class<? extends java.lang.Throwable>> rethrowExceptions)
           
 java.lang.Throwable translate(java.lang.Throwable applicationException)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultExceptionHandler

public DefaultExceptionHandler()
Method Detail

translate

public java.lang.Throwable translate(java.lang.Throwable applicationException)

handle

public void handle(LoomServletRequest request,
                   LoomServletResponse response,
                   java.lang.Throwable exception)
            throws java.io.IOException,
                   javax.servlet.ServletException
Specified by:
handle in interface ExceptionHandler
Throws:
java.io.IOException
javax.servlet.ServletException

redirectWithErrors

public void redirectWithErrors(LoomServletRequest request,
                               LoomServletResponse response)
                        throws java.io.IOException,
                               javax.servlet.ServletException
Description copied from interface: ExceptionHandler
Redirect to the source form page (extracted using the REFERER header). This method is invoked if the request cannot be processed due to user-introduced errors (such as conversion or validation errors). The request gets redirected to the source page, storing the current request data and error messages in the flash context to be restored later.

Specified by:
redirectWithErrors in interface ExceptionHandler
Throws:
javax.servlet.ServletException
java.io.IOException

setRethrowExceptions

public void setRethrowExceptions(java.util.Set<java.lang.Class<? extends java.lang.Throwable>> rethrowExceptions)