Hello.
 
I'm tying to migrate a project from wicket 1.4.18 to 1.5rc7.
I have a problem trying to add css and javascript links to my html code;
css and javascript files are located outside classpath (outside
WEB-INF). 
 
 
In wicket 1.4.18 I do:
 
add(CSSPackageResource.getHeaderContribution("css/main.css"));
 
and in html appears a relative css link like this:
 
        <link rel="stylesheet" type="text/css" href="../../css/main.css
<view-source:http://10.128.28.213:8000/plash/css/main.css> " />
 
wich is correct.
 
 
I want to do the same in wicket 1.5. I try
 
    @Override
    public void renderHead(final IHeaderResponse aResponse) {
        super.renderHead(aResponse);
 
aResponse.renderCSSReference(RequestCycle.get().getUrlRenderer().renderC
ontextRelativeUrl("css/main.css"));
    }
 
It works in some url, but in others it puts too much .. to the url; in
the same example I wrote before, now writes:
 
        <link rel="stylesheet" type="text/css"
href="../../../css/main.css <view-source:http://localhost/css/main.css>
" />
 
Debugging I see that
RequestCycle.get().getUrlRenderer().renderContextRelativeUrl("css/main.c
ss")returns the correct url, but function renderCSSReference adds more
.. to the url. More precisely, it's in line 231 of
org.apache.wicket.request.UrlRenderer, called from renderCSSReference,
where extra .. are added.
 
I'm using:
 
Wicket 1.5RC7
Windows xp
Jdk 1.5
Weblogic 9.2
 
Please help.
 
Matteo Sotil

Reply via email to