You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gianni <gd...@yahoo.it> on 2010/02/25 14:01:38 UTC

Redirect to bookmarkable page from self - broken in 1.4.6?

I've mounted a bookmarkable page as follows:

mount(new IndexedParamUrlCodingStrategy("destinations", DestinationGuidePage.class));

Then I've got a drop-down menu with an ajax behaviour to redirect to the same page with different parameters:

destinationChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
	@Override
	protected void onUpdate(AjaxRequestTarget target) {
		onUpdateSelection(target);
	}
});

protected void onUpdateSelection(AjaxRequestTarget target) {
	PageParameters params = new PageParameters("0=" + selectedCountry.getId());
	setResponsePage(DestinationGuidePage.class, params);
}

In 1.4.5 this works fine and the relative redirect is ../destinations/<my parameter>

DEBUG org.apache.wicket.Page - ending request for page [Page class = com.myapp.webapp.destguide.DestinationGuidePage, id = 3, version = 0], request [method = POST, protocol = HTTP/1.1, requestURL = http://local.mydomain.com:8180/myapp/URC107/, contentType = application/x-www-form-urlencoded, contentLength = 35, contextPath = /myapp/URC107, pathInfo = null, requestURI = /myapp/URC107/, servletPath = /URC107/, pathTranslated = null]
DEBUG org.apache.wicket.protocol.http.WebResponse - Redirecting to ../destinations/AN

This no longer works in 1.4.6 as it redirects to "destinations/<my parameter>" which results in the full URL /myapp/URC107/destinations/destinations/<my parameter>

DEBUG org.apache.wicket.Page - ending request for page [Page class = com.myapp.webapp.destguide.DestinationGuidePage, id = 6, version = 0], request [method = POST, protocol = HTTP/1.1, requestURL = http://local.mydomain.com:8180/myapp/URC107/, contentType = application/x-www-form-urlencoded, contentLength = 35, contextPath = /myapp/URC107, pathInfo = null, requestURI = /myapp/URC107/, servletPath = /URC107/, pathTranslated = null]
DEBUG org.apache.wicket.protocol.http.WebResponse - Redirecting to destinations/AT

I can't see any indications in the 1.4.6 release notes to say this behaviour may have changed, is this a bug?
-Gianni


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Redirect to bookmarkable page from self - broken in 1.4.6?

Posted by vineet semwal <vi...@gmail.com>.
i think it's the same known issue (2717),you can confirm the correct
behavior in 1.4.x.

On Thu, Feb 25, 2010 at 6:31 PM, Gianni <gd...@yahoo.it> wrote:

> I've mounted a bookmarkable page as follows:
>
> mount(new IndexedParamUrlCodingStrategy("destinations",
> DestinationGuidePage.class));
>
> Then I've got a drop-down menu with an ajax behaviour to redirect to the
> same page with different parameters:
>
> destinationChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
>        @Override
>        protected void onUpdate(AjaxRequestTarget target) {
>                onUpdateSelection(target);
>        }
> });
>
> protected void onUpdateSelection(AjaxRequestTarget target) {
>        PageParameters params = new PageParameters("0=" +
> selectedCountry.getId());
>        setResponsePage(DestinationGuidePage.class, params);
> }
>
> In 1.4.5 this works fine and the relative redirect is ../destinations/<my
> parameter>
>
> DEBUG org.apache.wicket.Page - ending request for page [Page class =
> com.myapp.webapp.destguide.DestinationGuidePage, id = 3, version = 0],
> request [method = POST, protocol = HTTP/1.1, requestURL =
> http://local.mydomain.com:8180/myapp/URC107/, contentType =
> application/x-www-form-urlencoded, contentLength = 35, contextPath =
> /myapp/URC107, pathInfo = null, requestURI = /myapp/URC107/, servletPath =
> /URC107/, pathTranslated = null]
> DEBUG org.apache.wicket.protocol.http.WebResponse - Redirecting to
> ../destinations/AN
>
> This no longer works in 1.4.6 as it redirects to "destinations/<my
> parameter>" which results in the full URL
> /myapp/URC107/destinations/destinations/<my parameter>
>
> DEBUG org.apache.wicket.Page - ending request for page [Page class =
> com.myapp.webapp.destguide.DestinationGuidePage, id = 6, version = 0],
> request [method = POST, protocol = HTTP/1.1, requestURL =
> http://local.mydomain.com:8180/myapp/URC107/, contentType =
> application/x-www-form-urlencoded, contentLength = 35, contextPath =
> /myapp/URC107, pathInfo = null, requestURI = /myapp/URC107/, servletPath =
> /URC107/, pathTranslated = null]
> DEBUG org.apache.wicket.protocol.http.WebResponse - Redirecting to
> destinations/AT
>
> I can't see any indications in the 1.4.6 release notes to say this
> behaviour may have changed, is this a bug?
> -Gianni
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
regards,
Vineet Semwal