[
https://issues.apache.org/jira/browse/WICKET-4030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098651#comment-13098651
]
Matteo Sotil edited comment on WICKET-4030 at 9/7/11 6:42 AM:
--------------------------------------------------------------
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. I've updated issue summary and
description to reflect it. 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?.
was (Author: msotil):
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 /* and wicket
> filter url-pattern 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
>
> In an application with a contextPath different than /*, and a wicket filter
> url-pattern different than /*, if you use
> HeaderResponse.renderCSSReference(String url), where url is a
> context-path-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