[seam-commits] Seam SVN: r10096 - trunk/src/main/org/jboss/seam/web.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Feb 27 15:00:57 EST 2009


Author: norman.richards at jboss.com
Date: 2009-02-27 15:00:57 -0500 (Fri, 27 Feb 2009)
New Revision: 10096

Modified:
   trunk/src/main/org/jboss/seam/web/RewritingResponse.java
Log:
JBSEAM-3771

Modified: trunk/src/main/org/jboss/seam/web/RewritingResponse.java
===================================================================
--- trunk/src/main/org/jboss/seam/web/RewritingResponse.java	2009-02-26 23:13:10 UTC (rev 10095)
+++ trunk/src/main/org/jboss/seam/web/RewritingResponse.java	2009-02-27 20:00:57 UTC (rev 10096)
@@ -75,13 +75,12 @@
         return url.getHost().equals(request.getServerName());
     }
     
-    public String rewritePath(String path) {
+    public String rewritePath(String originalPath) {
         String contextPath = request.getContextPath();
 
-        if (path.startsWith(contextPath)) {
-            path = path.substring(contextPath.length());
-        }
-
+        String path = originalPath.startsWith(contextPath) ? 
+                      originalPath.substring(contextPath.length()) : originalPath;
+                      
         for (Pattern pattern: patterns) {
             Rewrite rewrite = pattern.matchOutgoing(path);
             if (rewrite != null) {
@@ -89,10 +88,10 @@
             }
         }
 
-        return path;
+        return originalPath;
     }
 
-    public String rewriteURL(String originalUrl) {
+    public String rewriteURL(String originalUrl) {        
         if (originalUrl.startsWith("http://") || originalUrl.startsWith("https://")) {
             try {
                 URL url = new URL(originalUrl);




More information about the seam-commits mailing list