Updated Branches:
  refs/heads/master be73222f6 -> 16a17d96e

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/16a17d96
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/16a17d96
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/16a17d96

Branch: refs/heads/master
Commit: 16a17d96e693992490fa6911c3bbf2d40ef3d5e4
Parents: be73222
Author: martin-g <[email protected]>
Authored: Wed Feb 22 10:51:42 2012 +0100
Committer: Martin Tzvetanov Grigorov <[email protected]>
Committed: Wed Feb 22 10:52:21 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/16a17d96/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 793635d..c6622eb 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