Revision: 1444
http://stripes.svn.sourceforge.net/stripes/?rev=1444&view=rev
Author: bengunter
Date: 2011-12-01 20:46:56 +0000 (Thu, 01 Dec 2011)
Log Message:
-----------
Applied fix for STS-854 from 1.5.x branch.
Modified Paths:
--------------
trunk/stripes/src/net/sourceforge/stripes/exception/DefaultExceptionHandler.java
Modified:
trunk/stripes/src/net/sourceforge/stripes/exception/DefaultExceptionHandler.java
===================================================================
---
trunk/stripes/src/net/sourceforge/stripes/exception/DefaultExceptionHandler.java
2011-12-01 20:43:22 UTC (rev 1443)
+++
trunk/stripes/src/net/sourceforge/stripes/exception/DefaultExceptionHandler.java
2011-12-01 20:46:56 UTC (rev 1444)
@@ -17,6 +17,7 @@
import java.beans.PropertyDescriptor;
import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.URL;
@@ -102,11 +103,22 @@
}
/** Invokes the handler and executes the resolution if one is
returned. */
- public void handle(Throwable t, HttpServletRequest req,
HttpServletResponse res) throws Exception {
- Object resolution = handlerMethod.invoke(this.handler, t, req,
res);
- if (resolution != null && resolution instanceof Resolution) {
- ((Resolution) resolution).execute(req, res);
+ public void handle(Throwable t, HttpServletRequest req,
HttpServletResponse res) throws Exception {
+ try {
+ Object resolution = handlerMethod.invoke(this.handler, t, req,
res);
+ if (resolution != null && resolution instanceof Resolution) {
+ ((Resolution) resolution).execute(req, res);
+ }
}
+ catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof Exception)
+ throw (Exception) cause;
+ else if (cause instanceof Error)
+ throw (Error) cause;
+ else
+ throw e;
+ }
}
Method getHandlerMethod() {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development