Class InterMineExceptionHandler


  • public class InterMineExceptionHandler
    extends org.apache.struts.action.ExceptionHandler
    InterMine implementation of the Struts ExceptionHandler
    Author:
    Andrew Varley
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.apache.log4j.Logger LOG  
      • Fields inherited from class org.apache.struts.action.ExceptionHandler

        INCLUDE_PATH, SILENT_IF_COMMITTED
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.struts.action.ActionForward execute​(java.lang.Exception ex, org.apache.struts.config.ExceptionConfig ae, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm formInstance, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Handle the exception.
      protected void storeException​(javax.servlet.http.HttpServletRequest request, java.lang.String property, org.apache.struts.action.ActionMessage message, org.apache.struts.action.ActionForward forward, java.lang.String scope)
      Default implementation for handling an ActionMessage generated from an Exception during Action delegation.
      • Methods inherited from class org.apache.struts.action.ExceptionHandler

        determineIncludePath, handleCommittedResponse, logException
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        protected static final org.apache.log4j.Logger LOG
    • Constructor Detail

      • InterMineExceptionHandler

        public InterMineExceptionHandler()
    • Method Detail

      • execute

        public org.apache.struts.action.ActionForward execute​(java.lang.Exception ex,
                                                              org.apache.struts.config.ExceptionConfig ae,
                                                              org.apache.struts.action.ActionMapping mapping,
                                                              org.apache.struts.action.ActionForm formInstance,
                                                              javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response)
        Handle the exception. In this case we traverse the exception chain and report the message from each exception. The original exception and the stack trace are also added to the request.
        Overrides:
        execute in class org.apache.struts.action.ExceptionHandler
        Parameters:
        ex - The exception to handle
        ae - The ExceptionConfig corresponding to the exception
        mapping - The ActionMapping we are processing
        formInstance - The ActionForm we are processing
        request - The servlet request we are processing
        response - The servlet response we are creating
        Returns:
        an ActionForward
      • storeException

        protected void storeException​(javax.servlet.http.HttpServletRequest request,
                                      java.lang.String property,
                                      org.apache.struts.action.ActionMessage message,
                                      org.apache.struts.action.ActionForward forward,
                                      java.lang.String scope)
        Default implementation for handling an ActionMessage generated from an Exception during Action delegation. The default implementation is to set an attribute of the request or session, as defined by the scope provided (the scope from the exception mapping). An ActionErrors instance is created, the error is added to the collection and the collection is set under the Globals.ERROR_KEY.
        Overrides:
        storeException in class org.apache.struts.action.ExceptionHandler
        Parameters:
        request - - The request we are handling
        property - - The property name to use for this error
        message - - The message generated from the exception mapping
        forward - - The forward generated from the input path (from the form or exception mapping)
        scope - - The scope of the exception mapping.