Description
This is my second try to fix Wicket's encoding of redirects to intercepted URLs.
Instead of reopening WICKET-2007, I decided to create this new issue and make a clean start.
When Wicket redirects to an intercept page, it stores the original URL in PageMap#interceptContinuationURL.
// The intercept continuation URL should be saved exactly as the
// original request specified.
...
interceptContinuationURL = "/" + cycle.getRequest().getURL();
Note that comment and code are not in sync:
Instead of saving exactly the original request, a new URL is generated. ServletWebRequest#getURL() includes special characters non-encoded. Thus on a later continuation, the redirect to the original URL fails in case of special characters (umlauts in our case).
We're now using a subclass of ServletWebRequest, which utilizes the requestURI:
public String getURL()
{ // servletPath is de-encoded, so use requestURI minus contextPath instead // String url = getServletPath(); String url = httpServletRequest.getRequestURI().substring( httpServletRequest.getContextPath().length()); final String pathInfo = getHttpServletRequest().getPathInfo(); ... }I cannot say if this solution has unwanted side effects though.