continueToOriginal() leaves context on Tomcat
---------------------------------------------

                 Key: WICKET-3881
                 URL: https://issues.apache.org/jira/browse/WICKET-3881
             Project: Wicket
          Issue Type: Bug
          Components: wicket-core
    Affects Versions: 1.4.17
         Environment: Tomcat 5,6 and 7
            Reporter: Sven Meier


continueToOriginal() leaves the current web context on Tomcat, see attached 
quickstart.

Evaluation:
In ServletWebRequest#getRelativePathPrefixToContextRoot() the servletPath is 
used:

                String servletPath = getServletPath();
                if (servletPath.endsWith(path))
                {
                        int len = servletPath.length() - path.length() - 1;
                        if (len < 0)
                        {
                                len = 0;
                        }
                        wicketPath = servletPath.substring(0, len);
                }

Problem is that Tomcat returns "/index.html" as servletPath when:
- Wicket is running as filter (as usual)
- request path is ""
- welcome-file-list contains "index.html" (in web.xml or Tomcat's default)
- index.html exists
Note: Jetty would return "/". For more info see here:
https://issues.apache.org/bugzilla/show_bug.cgi?id=50161

The code above will evaluate wicketPath as "/index.htm" (should be ""), thus 
leading the following calculation to prepend an erroneous additional "../".

I've added a temporary workaround to my project by simply removing the 
index.html. But I'm really not sure what's the best way to fix this problem in 
Wicket.

Note that this problem does not exist with Wicket 1.5.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to