You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2013/02/27 10:47:14 UTC

[jira] [Resolved] (WICKET-4907) UrlResourceReference generates broken relative URLs

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

Martin Grigorov resolved WICKET-4907.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.7.0

UrlResourceReference has been improved to render its url as is. it wont be recalculated against the base url (the currently rendered page url). 
                
> UrlResourceReference generates broken relative URLs
> ---------------------------------------------------
>
>                 Key: WICKET-4907
>                 URL: https://issues.apache.org/jira/browse/WICKET-4907
>             Project: Wicket
>          Issue Type: Bug
>            Reporter: Andreas Kappler
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 6.7.0
>
>         Attachments: urlRenderInterface.patch, WICKET-4907.patch
>
>
> I am trying to render a reference to a Javascript library which is stored somewhere in my webapp directory using UrlResourceReference:
> public void renderHead(IHeaderResponse response) {
>         super.renderHead(response);
>         response.render(JavaScriptHeaderItem.forReference(new UrlResourceReference(Url.parse("public/scripts/jquery-ui-1.8.6.custom.min.js")) .setContextRelative(true)));
> }
> This does not work, because our wicket servlet is using a prefix ("nui"), and thus the URL to the resource (corrently) contains ".." but this is escaped for some reason to "::".
> So the URL generated by the ResourceReference is e.g. "http://localhost:8080/app/nui/::/public/scripts/jquery-ui-1.8.6.custom.min.js" leading to a 404. The correct URL would be "http://localhost:8080/app/nui/../public/scripts/jquery-ui-1.8.6.custom.min.js" As far as I can see, ParentPathReferenceRewriter does the escaping. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira