Multiple filter mappings in web.xml cause request.getUrl() to break
-------------------------------------------------------------------
Key: WICKET-3518
URL: https://issues.apache.org/jira/browse/WICKET-3518
Project: Wicket
Issue Type: Bug
Components: wicket-core
Affects Versions: 1.5-RC2
Environment: WebSphere 6.1
Reporter: Frans Stofberg
This issue is derived from WICKET-3497
Here is the problem
If I have two filter mappings in web.xml, only the 1st one gets loaded on the
servlet/filter startup. When calling request.getUrl() you get either an array
index out of bounds exception or part of the filter mapping in the url when you
access the app with the second mapping.
here is an example
2 mappings
/app/*
/longapp/*
when accessing with /app/ request.getUrl() works fine.
when accessing with /longapp/ request.getUrl() will return gapp/ (it takes the
length of /app/ as the star for the substring)
-------ServletWebRequest.getUrl()--------------
...
final int start = request.getContextPath().length() + filterPrefix.length() + 1;
url.append(uri.substring(start));
...
-------------------------------------------------------------
filterPrefix was loaded on the startup of the filter, which in this case is
/app/ (this is can not be correct)
you can see that if the mappings were reversed (/longapp/* before /app/*) in
web.xml the above code will throw an array/string index out of bounds exception
(and it does)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira