Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5.5
-
None
Description
We needed to create a page which links have absolute urls (protocol, host, port included). So I created a simple extension of MountedMapper that makes the relative url returned by super.mapHandler() to an absolute one.
So far so far but later Wicket uses org.apache.wicket.request.UrlRenderer#shouldRenderAsFull() to decide whether to actually render the url as full (i.e. as absolute) and since the protocol, the host and the port matches with the current request's url attributes it decides to render the url as relative.
Since Url class is final it is not possible to create a custom AbsoluteUrl which #toString() delegates to #toString(StringMode.FULL).
I see two solutions:
1) provide AbsoluteUrl class which is again final and uses StringMode.FULL
2) add a boolean flag to Url that is used by UrlRenderer#shouldRenderAsFull() so I can force full mode
Do you have other solutions ?