[ https://issues.apache.org/jira/browse/WICKET-5018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13625471#comment-13625471 ]
Martin Grigorov commented on WICKET-5018: ----------------------------------------- I can reproduce it now. The problem is in org.apache.wicket.protocol.http.servlet.ServletWebResponse#encodeRedirectURL() - it cannot properly relativize the produced encodedFullUrl because of the context path in the full url, the context path is missing in the base url. As a result the context path is considered a segment and it participates in the calculations with the segments. I'll try to find a solution. > redirectToInterceptPage results in 404 when url-rewriting is active > -------------------------------------------------------------------- > > Key: WICKET-5018 > URL: https://issues.apache.org/jira/browse/WICKET-5018 > Project: Wicket > Issue Type: Bug > Components: wicket > Affects Versions: 6.5.0 > Environment: tomcat 7, wicket 6.5, Firefox/Internetexplorer > Reporter: Jürgen Brardt > Attachments: QuickStart.20130228.zip, QuickStart.zip > > > I have the following setup: > Tomcat 7 with urlrewriting activated for sessionhandling > Page a is the homepage of my WicketApplication and requires the User to be > Authenticated. > If the caller is not Authorized, page b redirects to LoginPage l, which > contains an ajax-based loginform. After successfull login, the form calls > continueToOriginalDestination() which leads to an HTTP 404 error. > The URL-Causing the 404 result is sth. like: > /context//context/;jsessionId=...../?... > it should be sth. like: > /context/;jsessionId=.../? > the coding is: > class A extends WebPage{ > public A(){ > .. > if(Session.isLoggedIn() == false){ > redirectToInterceptPage(new L()); > } > } > class L extends WebPage{ > public L(){ > addForm(){ onSubmit(){ continueToOriginalDestination(); > } } > } > } > I tracked it Down to the ServletWebResponse.encodeUrl Method which does the > following: > fullUrl = http://localhost:8080/nubodent > encodedFullUrl = > http://localhost:8080/context;jsessionid=9C3C51AA3D018E44EA85044012CA504D > _encodedUrl = /contextt;jsessionid=9C3C51AA3D018E44EA85044012CA504D > after renderRelativeUrl > endcodeRelativeUrl = ..//context;jsessionid=9C3C51AA3D018E44EA85044012CA504D > and then back in the "browser" it is > /context//context;jsessionid=... > as stated above. > I wonder if there really is something wrong, or if Iam the Error, programming > it like this. > Thanks for any helpful hints. > Jürgen -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira