Hi, Custom root request mapper should be able to do it. Just check the request's URL - if it has no segments then return the home page, if it has one segment then return new RenderPageRequestHandler(AnotherPage.class, new PageParameters().add("param", segmentValue))
On Fri, Nov 4, 2011 at 2:53 PM, heikki <tropic...@gmail.com> wrote: > hello, > > I still find URL mapping to be far from easy. I can't get the following > mapping to work; all advice very much appreciated: > > intented mapping is: > > / --> map to IndexPage.class > /b --> map to AnotherPage.class with pageparameter > param="b" > /c --> map to AnotherPage.class with pageparameter > param="c" > > I tried creating a custom RootRequestMapper but I could not get it to work. > The closest I've come to achieving the above url mapping is with this in my > Application > > protected void init() { > super.init(); > mount(new MountedMapper("b", AnotherPage.class, new > CustomPageParametersEncoder("b"))); > mount(new MountedMapper("c", AnotherPage.class, new > CustomPageParametersEncoder("c"))); > } > public Class getHomePage() { > return IndexPage.class; > } > > where CustomPageParametersEncoder creates the pageparameter from the url in > method decodePageParameters(). > > What doesn't work here, is that requests to /b are turned into requests to > /c, with pageparameter "c". > > So I end up, when requesting /b, with /c in my browser address bar, and the > page saying "Hello, c", where I want to end up with /b in my address bar and > the page saying "Hello, b". > > Your advice is very much appreciated, > kind regards > Heikki Doeleman > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Mounting-external-pages-to-root-tp3890756p3989966.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > 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