You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "cs701 (JIRA)" <ji...@apache.org> on 2017/03/13 11:43:41 UTC

[jira] [Created] (WICKET-6338) regression in original destination Url rendering using RestartResponseAtInterceptPageException

cs701 created WICKET-6338:
-----------------------------

             Summary: regression in original destination Url rendering using RestartResponseAtInterceptPageException
                 Key: WICKET-6338
                 URL: https://issues.apache.org/jira/browse/WICKET-6338
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 7.4.0
         Environment: Windows 10 x64, Tomcat 8, Java 8
            Reporter: cs701


After moving a Wicket app from version 6 to 7.0.4 we ran into a regression concerning redirects via RestartResponseAtInterceptPageException.

When you throw new RestartResponseAtInterceptPageException(SomePage.class) the originalUrl saved in InterceptData contains protocol, host port
and a segment indicating the context-relative path of the original target page.

Once you call RestartResponseAtInterceptPageException.continueToOriginalDestination() the URL that is returned by renderUrl() is missing the context path
in Wicket 7, whereas it worked fine in 6.

Let's assume the original Url looked like this
	protocol: "http"
	host: "localhost"
	port: 8080
	segments: ["mypage"]
and the app is deployed in the context path /myapp

then Wicket 6 would have rendered this:

http://localhost:8080/myapp/mypage

whereas Wicket 7 does this:

http://localhost:8080/mypage

The reason being this difference in UrlRenderer.renderFullUrl():

	// Wicket 6
	if (url.isAbsolute() == false)
	{
		render.append(request.getContextPath());
		render.append(request.getFilterPath());
	}
	
	vs.
	
	// Wicket 7
    if ((!url.isFull()) && (!url.isContextAbsolute()))
    {
      render.append(this.request.getContextPath());
      render.append(this.request.getFilterPath());
    }
	
The "if" condition for the example Url above is true for the Wicket 6 version, but false for the Wicket 7 version.




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)