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

Url.parse does not support URL fragments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 6.18.0
    • None
    • wicket
    • None

    Description

      The org.apache.wicket.request.Url class does not seem to have support for URL fragments (the part of the URL following the # character and e.g. used for intra-page anchors in HTTP URLs).

      Url.parse will in all cases (as far as I can tell) encode the hash character with "%23", causing it to lose it's property as a fragment separator. If e.g. the URL http://server/page.html?arg=value#anchor is run through the Url class, it comes out as http://server/page.html?arg=value%23anchor. This factually changes the "arg" query parameters value from "value" to "value#anchor" and the fragment is lost.

      The issue occurs e.g. when throwing a RedirectToUrlException with status SC_MOVED_TEMPORARILY, since the provided URL is then parsed and treated with the org.apache.wicket.request.Url class. For some non-obvious reason, redirecting the response with SC_MOVED_PERMANENTLY or SC_SEE_OTHER sets the Location parameter in the HTTP response directly, without further processing of the redirecting URL or its components.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jarnbjo Tor-Einar Jarnbjo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: