You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Matej Knopp (JIRA)" <ji...@apache.org> on 2007/09/01 22:59:18 UTC

[jira] Commented: (WICKET-796) setresponsepage() does not properly redirect from ajax requests

    [ https://issues.apache.org/jira/browse/WICKET-796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524305 ] 

Matej Knopp commented on WICKET-796:
------------------------------------

Okay, this still doesn't work.
If you are on mounted page with parameters, such as /links/param/value
then the redirect works, but all resources on rendered page are prepended by way too much ../

> setresponsepage() does not properly redirect from ajax requests
> ---------------------------------------------------------------
>
>                 Key: WICKET-796
>                 URL: https://issues.apache.org/jira/browse/WICKET-796
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-beta1, 1.3.0-beta2
>            Reporter: Igor Vaynberg
>            Assignee: Eelco Hillenius
>             Fix For: 1.3.0-beta4
>
>
> if you are on a mounted page with parameters, lets say
> /context/page/param1/param2/
> and you call setresponsepage() from an NORMAL link on that page you will land on
> /context/?wicket:interface=...
> which is correct, however if you do it from an ajax link like so: onclick(ajaxrequesttarget target) { setresponsepage(new mypage()); } you will land on 
> /context/page/param1/param2/?wicket:interface=...
> which is INCORRECTl. notice that the mount and params were not stripped. also now because wicket thinks url depth is 0 urls will break, for example a resource requested from that page will be:
> /context/page/param1/param2/resources/..... woopsie
> why this happens:
> when setresponsepage is called the ?wicket:interface:foo::: url is constructed and passed to webresponse.redirect(url) which in turn calls httpServletResponse.sendRedirect(url); for normal responses or httpServletResponse.addHeader("Ajax-Location", url); for ajax responses. the big difference is how servletresponse handles this, and from the javadoc: This method can accept relative URLs; the servlet container will convert the relative URL to an absolute URL before sending the response to the client. 
> so what needs to be done is that httpServletResponse.addHeader("Ajax-Location", url); also needs to mangle the url and make it absolute.
> since you are the proxy guy and i dont know how this will play into that i am assigning it to you

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.