I think in wicket 1.4.x this is only possible with a custom mount point; In
other words:
Override/implement a version of bookmarkable page handling which takes into
accoun the locale.
Have a look at BookmarkablePageRequestTargetUrlCodingStrategy. You could
implement this class, overriding it's matches() method to match the mount
path and the locale. For encoding and decoding you should be able to use the
bookmarkable parts available in wicket.
PageWithLocaleUrlCodingStrategy extends
BookmarkablePageRequestTargetUrlCodingStrategy {
Locale locale;
// constructors of BPRTUCS with added Locale param
matches( IRequestTarget target ) {
return super.matches(target) &&
getSession().getLocale().equals(this.locale);
}
}
You can then mount like this (in application.init):
mount( new PageWithLocaleUrlCodingStrategy( "General", new
Locale("en","US"), MainPage.class ) );
etc
Hope this helps!
Bas
----- Original Message -----
From: ""Thomas Götz"" <t...@richmountain.de>
To: <users@wicket.apache.org>
Sent: Thursday, December 23, 2010 2:36 PM
Subject: Re: Localized mount points for BookmarkablePages?
Ok, thanks for that hint. But: if I mount the page using the method you
described, which mount name will be taken when referencing the page via a
BookmarkablePageLink? What I want to achieve is that if the current
user/session is set to locale "GERMAN" e.g., then all
BookmarkablePageLinks should be rendered with the german mount name, got
my point?
Cheers,
-Tom
----- Ursprüngliche Nachricht -----
Von: Hans Lesmeister
Gesendet: 23.12.10 13:05 Uhr
An: users@wicket.apache.org
Betreff: Re: Localized mount points for BookmarkablePages?
Hi, you van pass a list with alternates to the mount-annotation. Same
can be done on mounting programmatically.
Regards Hans
Am 23.12.2010 um 12:29 schrieb Thomas Götz <t...@richmountain.de>:
> Hi,
>
> is it possible to have localized mount points for BookmarkablePages?
>
> Example:
> I have a BookmarkablePage GeneralPage.java which should be available
> under
> http://my.domain.com/General and
> http://my.domain.com/Allgemein (german)
>
> ... depending on the current locale. Is this possible? If yes, could
> someone
> point me into the right direction?
>
> Cheers,
> -Tom
>
>
>
> ---------------------------------------------------------------------
> 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