In an older reply on this topic, Martijn Dashorst suggested to another user
to mount the page using one of the strategies that already exist or
implement your own.

Older thread "urlFor and putClassAlias":
http://apache-wicket.1842946.n4.nabble.com/urlFor-and-putClassAlias-tp186414
2p1864143.html

-----Original Message-----
From: Alec Swan [mailto:alecs...@gmail.com] 
Sent: Tuesday, September 04, 2012 5:18 PM
To: users@wicket.apache.org
Subject: Re: Wicket 1.5 migration questions

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?

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



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

Reply via email to