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

Eelco Hillenius updated WICKET-796:
-----------------------------------

    Fix Version/s:     (was: 1.3.0-beta3)
                   1.3.0-beta4

> 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
>            Priority: Critical
>             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.

Reply via email to