Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
6.18.0
-
None
-
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
- is related to
-
WICKET-5717 Url.parse/toString should support fragment
- Resolved
-
WICKET-5970 UrlRenderer does not render fragments
- Closed