[
https://issues.apache.org/jira/browse/WICKET-4030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098651#comment-13098651
]
Matteo Sotil commented on WICKET-4030:
--------------------------------------
In fact, response.renderCSSReference("css/main.css") was the first thing I
tried, but it did'nt work.
Now I see I've simplified too much the quickstart; the issue is produced when
wicket filter is different than /*, too. In quickstart, try changing wicket
filter mapping like this:
<filter-mapping>
<filter-name>wicket.myproject</filter-name>
<url-pattern>/wicket/*</url-pattern>
</filter-mapping>
Then use response.renderCSSReference("css/main.css") as you said. You will see
that generated href is ../css/main.css, wich points to
http://localhost:8080/contextPath/wicket/css/main.css, when it should be
../../css/main.css to point to http://localhost:8080/contextPath/css/main.css,
because css path passed to renderCSSReference should be _context-relative_
path, and not wicket-filter-url-pattern relative, isn't it?.
> HeaderResponse.renderCSSReference does not render correct css link with
> relative url in an application with contextPath different than /*
> -----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: WICKET-4030
> URL: https://issues.apache.org/jira/browse/WICKET-4030
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5-RC7
> Reporter: Matteo Sotil
> Assignee: Peter Ertl
> Priority: Minor
> Attachments: quickstart.zip
>
>
> In an application with a contextPath different than /*, if you use
> HeaderResponse.renderCSSReference(String url), where url is a relative url
> (../../css/main.css, for example), the generated css link is not correct when
> page path has some /.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira