[seam-commits] Seam SVN: r8017 - trunk/src/main/org/jboss/seam/mock.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Apr 24 08:27:27 EDT 2008


Author: dan.j.allen
Date: 2008-04-24 08:27:27 -0400 (Thu, 24 Apr 2008)
New Revision: 8017

Modified:
   trunk/src/main/org/jboss/seam/mock/MockExternalContext.java
Log:
JBSEAM-2924


Modified: trunk/src/main/org/jboss/seam/mock/MockExternalContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockExternalContext.java	2008-04-24 12:26:51 UTC (rev 8016)
+++ trunk/src/main/org/jboss/seam/mock/MockExternalContext.java	2008-04-24 12:27:27 UTC (rev 8017)
@@ -90,7 +90,7 @@
    @Override
    public String encodeActionURL(String url)
    {
-      return url;
+      return encodeURL(url);
    }
 
    @Override
@@ -102,7 +102,7 @@
    @Override
    public String encodeResourceURL(String url)
    {
-      return url;
+      return encodeURL(url);
    }
 
    @Override
@@ -530,4 +530,20 @@
       return response.getContentType();
    }
 
+   /**
+    * Attempt to encode the URL, falling back to
+    * an identity function if the response has
+    * not been set on this mock context. This
+    * functionality is needed in order for
+    * the ExceptionFilter to maintain the session id
+    * when url rewriting is used.
+    */
+   protected String encodeURL(String url)
+   {
+      if (response != null) {
+         String encodedUrl = response.encodeURL(url); 
+         url = (encodedUrl != null ? encodedUrl : url);
+      }
+      return url;
+   }
 }




More information about the seam-commits mailing list