I take it by global you mean http://myServer:###/myWebApp/global?
If so, why don't you just add the folder to the root of your war? See how the static file such as HTML pages and images are handled in a Web Module: http://docs.oracle.com/cd/E13222_01/wls/docs70/webapp/basics.html#136976 ~ Thank you, Paul Bors -----Original Message----- From: Alec Swan [mailto:alecs...@gmail.com] Sent: Monday, September 10, 2012 7:43 PM To: users@wicket.apache.org Subject: Re: Wicket 1.5 migration questions Any update on this? How can I mount CSS and JS resources under /global/ without having to do a mountResource() for every such file? Thanks, Alec On Thu, Sep 6, 2012 at 12:07 PM, Alec Swan <alecs...@gmail.com> wrote: > But I want JavaScript files to be compresses by > JavaScriptResourceReference and CSS be served as > PackageResourceReference. How do I mount them both under /global URL > suffix? > > On Thu, Sep 6, 2012 at 12:02 PM, Martin Grigorov <mgrigo...@apache.org> wrote: >> extend PackageResourceReference and override its #getName() to read >> the name from the request path/parameters mountResource("/global", >> new MyPRR()) >> >> On Thu, Sep 6, 2012 at 7:57 PM, Alec Swan <alecs...@gmail.com> wrote: >>> In 1.4 I had the following classes in com.myco.app.res package: >>> >>> GlobalJavascriptResourceReference extends >>> JavaScriptResourceReference GlobalCompressedResourceReference >>> extends PackageResourceReference GlobalResourceScope >>> >>> And Application had the following code: >>> getSharedResources().putClassAlias(GlobalResourceScope.class, >>> "global") >>> >>> The caller would add resources as follows: >>> new GlobalJavascriptResourceReference(GlobalResourceScope.class, >>> "js/common.js"); >>> new GlobalCompressedResourceReference(GlobalResourceScope.class, >>> "css/styles.css"); >>> >>> How should I port this to 1.5 so that I can still access >>> http://../global/js/common.js and http://../global/js/styles.css? >>> >>> Thanks, >>> >>> Alec >>> >>> On Tue, Sep 4, 2012 at 5:10 PM, Martin Grigorov <mgrigo...@apache.org> wrote: >>>> On Tue, Sep 4, 2012 at 11:17 PM, Alec Swan <alecs...@gmail.com> wrote: >>>>> Well, mountPackage did not work for me either. >>>>> >>>>> Basically, what I want to do is access ALL resources in >>>>> com.myco.app.res package with "global" URL prefix. For example, >>>>> access a JavaScript file as global/events.js instead of >>>>> ../wicket/resource/com.myco.app.res.GlobalResourceScope/events.js URL. >>>>> In 1.4 it was simple with >>>>> putClassAlias(com.myco.app.res.GlobalResourceScope, "global"). >>>>> >>>>> How can I do this with 1.5? >>>> >>>> Why #mountResource() didn't work for you ? >>>> >>>>> >>>>> Thanks, >>>>> >>>>> Alec >>>>> >>>>> On Tue, Sep 4, 2012 at 10:59 AM, Alec Swan <alecs...@gmail.com> wrote: >>>>>> Tom, >>>>>> >>>>>> I have com.myco.app.res.GlobalResourceScope.class and events.js >>>>>> in the same package. So, putClassAlias(GlobalResourceScope.class, >>>>>> "global") in 1.4 would allow me to access >>>>>> http://../app/global/events.js in the browser. >>>>>> >>>>>> It seems like in 1.5 this is similar to mountPackage(String, Class<? >>>>>> extends Page>) which means I have to change GlobalResourceScope >>>>>> class to extend Page, right? Why does it need to be a Page? >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Alec >>>>>> >>>>>> On Tue, Sep 4, 2012 at 9:42 AM, Thomas Götz <t...@decoded.de> wrote: >>>>>>> I didn't get your usecase exactly yet, but maybe this will help you: >>>>>>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ >>>>>>> >>>>>>> Cheers, >>>>>>> -Tom >>>>>>> >>>>>>> >>>>>>> On 04.09.2012, at 17:33, Alec Swan <alecs...@gmail.com> wrote: >>>>>>> >>>>>>>> I saw the link explaining how to migrate >>>>>>>> "SharedResources#putClassAlias(GlobalResourceScope.class, "global")" >>>>>>>> before but was found it confusing because "global" and "images" >>>>>>>> aliases 1.4 version were replaced with "imgres" in 1.5 example. >>>>>>>> >>>>>>>> All I need to do is use "global" in place of >>>>>>>> GlobalResourceScope.class in the URLs. How do I do this in 1.5? >>>>>>> >>>>>>> >>>>>>> ---------------------------------------------------------------- >>>>>>> ----- 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 >>>>> >>>> >>>> >>>> >>>> -- >>>> Martin Grigorov >>>> jWeekend >>>> Training, Consulting, Development >>>> http://jWeekend.com >>>> >>>> ------------------------------------------------------------------- >>>> -- 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 >>> >> >> >> >> -- >> Martin Grigorov >> jWeekend >> Training, Consulting, Development >> http://jWeekend.com >> >> --------------------------------------------------------------------- >> 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