You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Peter Ertl (JIRA)" <ji...@apache.org> on 2011/03/10 01:59:59 UTC

[jira] Resolved: (WICKET-3518) Multiple filter mappings in web.xml cause request.getUrl() to break

     [ https://issues.apache.org/jira/browse/WICKET-3518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Ertl resolved WICKET-3518.
--------------------------------

       Resolution: Won't Fix
    Fix Version/s: 1.5-RC3

Wicket currently does not support multiple filter / servlet paths and probably never will. There is not much reason to make things a lot more complicated inside wicket core for a tiny benefit in a very rare use case. If you really need flexible urls you could consider using a front-end proxy like apache or nginx which gives you all the power of rewriting urls, even better than by utilizing web.xml's restricted possibilties.

> 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
>            Assignee: Peter Ertl
>             Fix For: 1.5-RC3
>
>
> 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