Hi Sam,

I think you can use this:
UrlUtils.rewriteToContextRelative("ui/images/datepicker.png",
RequestCycle.get());

It also works in Wicket 6.

Regards,
Sebastien.

On Tue, Jul 10, 2012 at 7:22 PM, Sam Zilverberg <[email protected]>wrote:

> Hi,
>
> First let me say that I already searched through nabble and stackoverflow
> but didn't find a good solution to, what seems to me, a simple problem.
>
> I'm migrating my app from 1.4.17 to 1.5.5.
> In 1.4 I put a lot of images under webapp/ui/images .
> I'd use images from that folder mainly for css and javascript options:
> css:  background: url("ui/images/logo_new_trans.gif") no-repeat scroll 0 0
> transparent;
> js : $(#bla}.something(buttonImage:'ui/images/datepicker.png');
>
> I'm using wiquery so the above image url for js was put in using java code
> - the url was determined at run time.
>
> After migrating to 1.5 the css referenced images work but the JS do not.
> If I play around using firebug i can get the JS images to work by adding
> "../" before the existing url.
>
> What is a good way of getting this to work again?
> Can I somehow use wicket to resolve the url from a component to the static
> dir?  so when I programatically pass the url using wiquery I can put in the
> correct one...
>
> Thanks,
> Sam
>

Reply via email to