[
https://issues.apache.org/jira/browse/WICKET-3518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005572#comment-13005572
]
Frans Stofberg commented on WICKET-3518:
----------------------------------------
okay,
But one more question.
would It be acceptable to have multiple servlets configured, each with its own
mapping?
eg...
servlet-name: servlet.app1
mapping: /app/*
servlet-name: servlet.app2
mapping: /longapp/*
I found that this does work, I just dont know If I may run into issues like
this. Do you foresee any?
> 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