You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Christian Huber <hu...@butterbrot.org> on 2011/08/24 21:28:43 UTC

Create Url for Application Homepage

Hi,

the method Component#urlFor(Class pageClass, PageParameters parameters) 
allows you to create an application relative link that could be used as 
dynamic links or stored in a database to be accessed later. Now I 
noticed that links created for the page set as the applications HomePage 
the result does not contain the wicket:bookmarkablePage portion. I 
figure this is an optimization.

Those links work fine as long as the HomePage class does not change. But 
what if due to some refactoring you want to set another page as 
application HomePage? Since those links usually contain page dependent 
parameters the chance old bookmark links won't work or even cause an 
application error are pretty high.

So I would like to avoid this optimization to kick in and have all links 
created in the same way. Does anyone know if this can be done?

Thanks, Chris

-- 
The Sanity Resort <http://sanityresort.blogspot.com/>

Re: Create Url for Application Homepage

Posted by Christian Huber <hu...@butterbrot.org>.
Aaaahh.. cool. Works great. Thanks :-)

The Sanity Resort <http://sanityresort.blogspot.com/>

Am 24.08.2011 21:44, schrieb Martin Grigorov:
> mount your home page
> for HomePage1: /home1
> for HomePage2: /home2
>
> voila!
>
> On Wed, Aug 24, 2011 at 10:28 PM, Christian Huber<hu...@butterbrot.org>  wrote:
>> Hi,
>>
>> the method Component#urlFor(Class pageClass, PageParameters parameters)
>> allows you to create an application relative link that could be used as
>> dynamic links or stored in a database to be accessed later. Now I noticed
>> that links created for the page set as the applications HomePage the result
>> does not contain the wicket:bookmarkablePage portion. I figure this is an
>> optimization.
>>
>> Those links work fine as long as the HomePage class does not change. But
>> what if due to some refactoring you want to set another page as application
>> HomePage? Since those links usually contain page dependent parameters the
>> chance old bookmark links won't work or even cause an application error are
>> pretty high.
>>
>> So I would like to avoid this optimization to kick in and have all links
>> created in the same way. Does anyone know if this can be done?
>>
>> Thanks, Chris
>>
>> --
>> The Sanity Resort<http://sanityresort.blogspot.com/>
>>
>
>

Re: Create Url for Application Homepage

Posted by Martin Grigorov <mg...@apache.org>.
mount your home page
for HomePage1: /home1
for HomePage2: /home2

voila!

On Wed, Aug 24, 2011 at 10:28 PM, Christian Huber <hu...@butterbrot.org> wrote:
> Hi,
>
> the method Component#urlFor(Class pageClass, PageParameters parameters)
> allows you to create an application relative link that could be used as
> dynamic links or stored in a database to be accessed later. Now I noticed
> that links created for the page set as the applications HomePage the result
> does not contain the wicket:bookmarkablePage portion. I figure this is an
> optimization.
>
> Those links work fine as long as the HomePage class does not change. But
> what if due to some refactoring you want to set another page as application
> HomePage? Since those links usually contain page dependent parameters the
> chance old bookmark links won't work or even cause an application error are
> pretty high.
>
> So I would like to avoid this optimization to kick in and have all links
> created in the same way. Does anyone know if this can be done?
>
> Thanks, Chris
>
> --
> The Sanity Resort <http://sanityresort.blogspot.com/>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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