I did something similar. All you have to do is to create your own implementation of IRequestCodingStrategy. You can find the code at this link: http://pastebin.com/m458b5433 LocaleUrlCodingStrategyDecorator
Alex Objelean Jonathan and Carrie Olson wrote: > > Hello, > > I've been investigating Wicket for building an educational site, and > there's > one issue that's been nagging me: > > The majority of our URLs would need to be pretty, bookmarkable, and start > with a locale, like: > http://www.example.com/en/test/1 > or > http://www.example.com/zh_CN/page-search/penguin > Where the "en" and "zh_CN" are the locales to be used, usually followed by > one or more slash-separated tokens that uniquely identify a page, followed > by zero or more slash-separated tokens that are parameters. Ideally, the > locale and parameters would be passed into a WebPage with the > PageParameters. > > Is there an elegant way to accomplish this? I've resorted to having the > application mount a custom class implementing > IRequestTargetUrlCodingStrategy for each locale ("en", "zh_CN"), that adds > the locale to the page parameters, and then uses regular expressions to > identify the class of the Page. This seems like somewhat of a hack, where > encode(IRequestTarget) is left unimplemented and using links seems more > difficult. > > -Jonathan Olson > > -- View this message in context: http://www.nabble.com/Is-IRequestTargetUrlCodingStrategy-needed-for-mapping-bookmarkable--URLs--tp24407411p24409330.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
