Redirecting to the home page after binding the session leads to Wicket creating
an invalid URL
----------------------------------------------------------------------------------------------
Key: WICKET-3841
URL: https://issues.apache.org/jira/browse/WICKET-3841
Project: Wicket
Issue Type: Bug
Components: wicket-core
Affects Versions: 1.5-RC5.1
Environment: Mac Safari 5.0.5
Reporter: Matt Brictson
Attachments: WICKET-3841-quickstart.tgz
This issue is demonstrated in the attached quickstart.
Consider a stateless page that contains a form. When the user loads this page,
a servlet session does not yet exist.
Now, in the onSubmit() of the form, call Session.get().bind(). This forces a
servlet session to be created. The response to the form submission will thus
contain a session cookie, and if a redirect is performed the URL will be
rewritten to include a jsessionid.
A problem occurs when a redirect to the home page is performed in this
scenario. Wicket responds with a Location header that looks like this:
Location: http://localhost:8080;jsessionid=cck8jr4b1vdtd5h7a17qv9bn
If I'm not mistaken this is an invalid URL. There should be a forward-slash
between 8080 and ;jsessionid.
Safari on the Mac reports the following error:
"Safari can't open the page
"http://localhost:8080;jsessionid=cck8jr4b1vdtd5h7a17qv9bn/" because Safari
can't connect to the server "localhost".
If you then press the reload button in Safari, the error changes to:
"Safari can't open the page
"http://localhost:8080;jsessionid=cck8jr4b1vdtd5h7a17qv9bn/" because the page's
address isn't valid."
Other browsers, like Firefox 5.0, seem to automatically correct Wicket's
mistake and do not report an error.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira