dgraham 2003/07/25 17:13:21
Modified: src/share/org/apache/struts/action ExceptionHandler.java
Log:
Added logException() method for PR# 21569.
Revision Changes Path
1.19 +24 -5
jakarta-struts/src/share/org/apache/struts/action/ExceptionHandler.java
Index: ExceptionHandler.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ExceptionHandler.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ExceptionHandler.java 19 Apr 2003 01:20:32 -0000 1.18
+++ ExceptionHandler.java 26 Jul 2003 00:13:20 -0000 1.19
@@ -58,25 +58,33 @@
* <http://www.apache.org/>.
*
*/
+
package org.apache.struts.action;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.struts.Globals;
import org.apache.struts.config.ExceptionConfig;
import org.apache.struts.util.ModuleException;
/**
- * An ExceptionHandler is configured in the Struts configuration file to handle a
specific
- * type of exception thrown by an Action's execute method.
+ * An ExceptionHandler is configured in the Struts configuration file to handle a
+ * specific type of exception thrown by an Action's execute method.
*
* @since Struts 1.1
*/
public class ExceptionHandler {
/**
+ * Commons logging instance.
+ */
+ private static final Log log = LogFactory.getLog(ExceptionHandler.class);
+
+ /**
* Handle the exception.
* Return the <code>ActionForward</code> instance (if any) returned by
* the called <code>ExceptionHandler</code>.
@@ -121,11 +129,22 @@
property = error.getKey();
}
+ this.logException(ex);
+
// Store the exception
request.setAttribute(Globals.EXCEPTION_KEY, ex);
storeException(request, property, error, forward, ae.getScope());
return forward;
+ }
+
+ /**
+ * Logs the exception using commons-logging.
+ * @param e The Exception to log.
+ * @since Struts 1.2
+ */
+ protected void logException(Exception e){
+ log.debug(e);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]