[
https://issues.apache.org/jira/browse/WICKET-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13429597#comment-13429597
]
Darryl L. Miles commented on WICKET-4625:
-----------------------------------------
I believe my patch caters correctly for the servlet specification standards
that you cite. As this is my understanding too which is also documented in the
patch history log entry.
My patch does cater for an additional case that seems to only be present in
Wicket unit tests, i.e. it is the way the mock object works, and my point of
hilighting it is to point out that the mock objects maybe violating the servlet
specification(s). This is re: HttpServletRequest.getContextPath() but the
patch caters for it anyway.
I have not knowingly tried to cater for a bug in jetty, so if such a bug exists
I should re-evaluate to confirm the patch continues to do the right thing. I
think the Wicket project should be lenient in what it accepts and strict in
what it emits (to paraphrase the interoperability mantra from RFC1122).
Also it is possible that the writers of Wicket use jetty more than other
servlet containers and have come to think that this is how all servlet
containers work (bugs observed included). Which is why the bug may have
existed in the first place.
So to be clear what I am saying, I believe there is a bug in wicket and this
patch fixes it. To answer your question directly.
Since I had problems on Tomcat which is my deployment container of choice,
these problems caused me to look into Wicket to produce this patch. I believe
Tomcat does the correct thing regards servlet specification and
getContextPath().
Now you are suggesting there maybe a bug also in Jetty. So I suggest this
might be why wicket has the bug in it as it is unit tested against jetty and
mocks copied from jetty behaviour ? (This is speculation on my part).
So can you confirm which version of Jetty you are using ? which version(s) of
wicket you are able to observe a problem/bug/unwanted behaviour ?
Then can you implement my patch and retest, then confirm if the
problem/bug/unwanted behaviour remains, changes or disappears.
Thanks
> ServletWebRequest#getContextRelativeUrl() sometimes chops off leading
> characters
> --------------------------------------------------------------------------------
>
> Key: WICKET-4625
> URL: https://issues.apache.org/jira/browse/WICKET-4625
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 1.5.7
> Reporter: Darryl L. Miles
> Attachments:
> 0001-WICKET-4625-ServletWebRequest-getContextRelativeUrl-.patch
>
>
> This patch reduces the number of nonsense return value this method might
> produce. I have clarified the in JavaDoc the expected inputs to the method.
> It is still possible to still get a nonsense return values in some use cases,
> all scenarios are documented and tested in a new test case.
> This method presumes that the input "uri" on the 1st argument always has the
> ContextPath and then the FilterPrefix on the front of the URL.
> Some unit tests were actually checking the nonsense return values were being
> returned these have been updated.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira