Description
The fix for https://issues.apache.org/jira/browse/WICKET-4387 includes the following code in org.apache.wicket.protocol.http.servlet.ServletWebRequest#ServletWebRequest(HttpServletRequest httpServletRequest, String filterPrefix, Url url):
if (forwardAttributes != null || errorAttributes != null)
{
if (LOG.isDebugEnabled())
{
LOG.debug("Setting filterPrefix('{}') to '' because there is either an error or a forward. {}, {}",
new Object[]
);
}
// the filter prefix is not needed when the current request is internal
// see WICKET-4387
this.filterPrefix = "";
The filterPrefix is actually needed later when a request is made due to an error (e.g. 404):
public Url getClientUrl()
{
if (errorAttributes != null && !Strings.isEmpty(errorAttributes.getRequestUri()))
{
String problematicURI = Url.parse(errorAttributes.getRequestUri(), getCharset())
.toString();
return getContextRelativeUrl(problematicURI, filterPrefix);
With filterPrefix=="" the urls for any resources in the error page are wrong.
Attachments
Attachments
Issue Links
- is broken by
-
WICKET-4387 StringIndexOutOfBoundsException when forwarding requests
- Resolved
- is related to
-
WICKET-5018 redirectToInterceptPage results in 404 when url-rewriting is active
- Resolved