Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3841

Redirecting to the home page after binding the session leads to Wicket creating an invalid URL

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5-RC5.1
    • Fix Version/s: 1.5-RC6
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Mac Safari 5.0.5

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              pete Peter Ertl
              Reporter:
              mbrictson Matt Brictson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: