Updated Branches:
  refs/heads/wicket-1.5.x fda2e7962 -> 4c1278b5b

WICKET-4387 StringIndexOutOfBoundsException when forwarding requests

Reset the filterPath if the request is internal (forward or error).


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/4c1278b5
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/4c1278b5
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/4c1278b5

Branch: refs/heads/wicket-1.5.x
Commit: 4c1278b5b5cf9c914a5015c13736d3bf3cd91ef4
Parents: fda2e79
Author: martin-g <[email protected]>
Authored: Wed Feb 22 10:51:42 2012 +0100
Committer: martin-g <[email protected]>
Committed: Wed Feb 22 10:51:42 2012 +0100

----------------------------------------------------------------------
 .../protocol/http/servlet/ServletWebRequest.java   |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/4c1278b5/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebRequest.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebRequest.java
 
b/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebRequest.java
index 576f44c..274e1fb 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebRequest.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebRequest.java
@@ -94,12 +94,21 @@ public class ServletWebRequest extends WebRequest
                Args.notNull(filterPrefix, "filterPrefix");
 
                this.httpServletRequest = httpServletRequest;
-               this.filterPrefix = filterPrefix;
 
                errorAttributes = ErrorAttributes.of(httpServletRequest);
 
                forwardAttributes = ForwardAttributes.of(httpServletRequest);
 
+               if (forwardAttributes != null || errorAttributes != null)
+               {
+                       // the filter prefix is not needed when the current 
request is internal
+                       // see WICKET-4387
+                       this.filterPrefix = "";
+               } else
+               {
+                       this.filterPrefix = filterPrefix;
+               }
+
                if (url != null)
                {
                        this.url = url;

Reply via email to