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

Martin Grigorov resolved WICKET-4639.
-------------------------------------

    Resolution: Not A Problem

RequestUtils.toAbsolutePath() works fine. The problem is that you pass it 
incorrect information as current url.
The *current* url is the one in the browser's address bar, while you use the 
Ajax request's url instead.

Here is the code that fixes your application:

    public final static String toAbsolutePath(final String relativePagePath) {
            String s = 
RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(relativePagePath));
            return s;
    }

UrlRendered uses the 'baseUrl' which is the url in the address bar even for 
Ajax requests.
                
> Make RequestUtils.toAbsolutepath generate correct url for BookMarkablePages 
> that haven't had "mountPage" set
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4639
>                 URL: https://issues.apache.org/jira/browse/WICKET-4639
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5.7
>         Environment: Linux x86_64, jetty
>            Reporter: J
>         Attachments: wicketchart.zip
>
>
> When using RequestUtils,toAbsolutePath it will generate bad urls if the page 
> the sent the request was a bookmarkablepage that hadn't been mapped with 
> mountPage.Same example works when mapped with mountPage. I have prepared a 
> quickstart example (Based on code from the wicket cookbook)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to