You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2007/12/12 21:00:43 UTC

svn commit: r603718 - in /tiles/framework/trunk: tiles-core/src/main/java/org/apache/tiles/servlet/context/ServletTilesRequestContext.java tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspTilesRequestContext.java

Author: apetrelli
Date: Wed Dec 12 12:00:42 2007
New Revision: 603718

URL: http://svn.apache.org/viewvc?rev=603718&view=rev
Log:
TILES-230
Fixed messages when wrapping exception.

Modified:
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/context/ServletTilesRequestContext.java
    tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspTilesRequestContext.java

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/context/ServletTilesRequestContext.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/context/ServletTilesRequestContext.java?rev=603718&r1=603717&r2=603718&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/context/ServletTilesRequestContext.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/context/ServletTilesRequestContext.java Wed Dec 12 12:00:42 2007
@@ -190,7 +190,8 @@
         try {
             rd.forward(request, response);
         } catch (ServletException ex) {
-            throw wrapServletException(ex, path);
+            throw wrapServletException(ex, "ServletException including path '"
+                    + path + "'.");
         }
     }
 
@@ -202,7 +203,8 @@
         try {
             rd.include(request, response);
         } catch (ServletException ex) {
-            throw wrapServletException(ex, path);
+            throw wrapServletException(ex, "ServletException including path '"
+                    + path + "'.");
         }
     }
 
@@ -270,20 +272,18 @@
      * Wraps a ServletException to create an IOException with the root cause if present.
      *
      * @param ex The exception to wrap.
-     * @param path The path that failed.
+     * @param message The message of the exception.
      * @return The wrapped exception.
      */
-    protected IOException wrapServletException(ServletException ex, String path) {
+    protected IOException wrapServletException(ServletException ex, String message) {
         IOException retValue;
         Throwable rootCause = ex.getRootCause();
         if (rootCause != null) {
             // Replace the ServletException with an IOException, with the root
             // cause of the first as the cause of the latter.
-            retValue = new IOException("JSPException while including path '"
-                    + path + "'.", rootCause);
+            retValue = new IOException(message, rootCause);
         } else {
-            retValue = new IOException("JSPException while including path '"
-                    + path + "'.", ex);
+            retValue = new IOException(message, ex);
         }
 
         return retValue;

Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspTilesRequestContext.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspTilesRequestContext.java?rev=603718&r1=603717&r2=603718&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspTilesRequestContext.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspTilesRequestContext.java Wed Dec 12 12:00:42 2007
@@ -79,7 +79,8 @@
         try {
             pageContext.include(path, false);
         } catch (ServletException e) {
-            throw wrapServletException(e, path);
+            throw wrapServletException(e, "JSPException including path '"
+                    + path + "'.");
         }
     }