Same way as is mounted .js and .css mount images and then in .css you can
just use this path.
 

> -----Original Message-----
> From: Alec Swan [mailto:alecs...@gmail.com] 
> Sent: Friday, 05. August 2011 19:30
> To: users@wicket.apache.org
> Subject: Re: I am having trouble mounting shared resources
> 
> Thanks, mounting JS worked perfectly.
> 
> However, mounting CSS was problematic because it references 
> quite a few images and they don't get loaded/mounted 
> correctly. How do I mount the folder that contains all images 
> so that they can be loaded from the CSS?
> 
> Thanks,
> 
> Alec
> 
> 
> On Fri, Aug 5, 2011 at 11:51 AM, Miroslav F. <mir...@seznam.cz> wrote:
> > Project dirs:
> >
> > ..... com.myapp
> > .....      MyStartAppPoint.java
> > ..... com.myapp.resources
> > .....      MyResources.java
> > .....      fancybox-123.js
> >
> > In MyStartAppPoint.init() do:
> >
> > mountSharedResource("/js/fancybox.js", new 
> > ResourceReference(MyResources.class,
> > "fancybox-123.js").getSharedResourceKey());
> >
> > MyResources.java is just empty class (for classloader to find your
> > resource):
> > package com.myapp.resources;
> > public class MyResources
> > {
> > }
> >
> > and then in html markup you can write:
> > <script type="text/javascript" src="./js/fancybox.js"></script>
> >
> > Hope helps,
> >
> > Miro
> >
> >
> >
> >
> >> -----Original Message-----
> >> From: Alec Swan [mailto:alecs...@gmail.com]
> >> Sent: Friday, 05. August 2011 08:42
> >> To: users@wicket.apache.org
> >> Subject: I am having trouble mounting shared resources
> >>
> >> Hello,
> >>
> >> I am having troubles figuring out how to organize my 
> static resources.
> >>
> >> I would like to map a static URL alias, e.g. /js/fancybox, 
> to a file 
> >> such as /js/fancybox/version123/fancybox-123.js. I also want to be 
> >> able to update the file version and after that have it 
> served under 
> >> the same alias. This assumes that I will modify my Java code to 
> >> reference the new file name.
> >>
> >> I think I need to create a resource reference class that points to 
> >> /js/fancybox/version123/fancybox-123.js and mount it in my Wicket 
> >> Application. But I can only mount a resource, not a 
> >> JavaScriptResourceReference in Application.init().
> >>
> >> Can anybody please explain how to do this right?
> >>
> >> Thanks
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to