[
https://issues.apache.org/jira/browse/WICKET-4030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098144#comment-13098144
]
Peter Ertl commented on WICKET-4030:
------------------------------------
The problem is:
response.renderCSSReference(path) expects a context-relative(!) path (see
javadoc). This is not to be confused with the effective path that get's
rendered.
basically what you did wrong is call
response.renderCSSReference("../css/main.css")
when instead you should use the _context-relative_ path (relative to
"/contextPath" in your sample).
So the correct method call is
response.renderCSSReference("css/main.css")
It will work no matter how you mount your home page or if you mount it at all.
In any case wicket will generate the required number of ".." in the path.
> 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