Re: How to resolve page from url part without (hardcoded) mapping in application class
thank you again ... works like a charm ;) Regards Armando -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-page-from-url-part-without-hardcoded-mapping-in-application-class-tp4663992p4664012.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
Re: How to resolve page from url part without (hardcoded) mapping in application class
this will do .. thank you ! Regards Armando -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-page-from-url-part-without-hardcoded-mapping-in-application-class-tp4663992p4664003.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
Re: How to resolve page from url part without (hardcoded) mapping in application class
You have to setup your mapper as root and keep the old root mapper as a delegate. See https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java?source=c#L54 If your mapper resolves a page for the current url then return RenderPageRequestHandler(new PageProvider(SomePage.class)). If there is no match then use the delegate to resolve it. See https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java?source=c#L92 Martin Grigorov Wicket Training and Consulting On Tue, Jan 28, 2014 at 4:52 PM, armandoxxx wrote: > Hey ... > > sorry but I don't understand > > the problem is that chain property in custom mapper is set upon > initialization in application class and it sets page .. > getRootRequestMapperAsCompound().add(new LocaleFirstMapper(new > MountedMapper("/localized", LocalizedPage.class))); > > I'm trying to figure out how to do this in custom IRequestMapper > implementation since my Page Class will change on each request ... > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-page-from-url-part-without-hardcoded-mapping-in-application-class-tp4663992p4663997.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 > >
Re: How to resolve page from url part without (hardcoded) mapping in application class
Hey ... sorry but I don't understand the problem is that chain property in custom mapper is set upon initialization in application class and it sets page .. getRootRequestMapperAsCompound().add(new LocaleFirstMapper(new MountedMapper("/localized", LocalizedPage.class))); I'm trying to figure out how to do this in custom IRequestMapper implementation since my Page Class will change on each request ... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-page-from-url-part-without-hardcoded-mapping-in-application-class-tp4663992p4663997.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
Re: How to resolve page from url part without (hardcoded) mapping in application class
Hi, You can use custom IRequestMapper that reads the url and asks the DB which page to use. Use WebApplication#setRootRequestMapper() to set it. See https://github.com/apache/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java?source=c https://github.com/apache/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperApplication.java#L55 for example Martin Grigorov Wicket Training and Consulting On Tue, Jan 28, 2014 at 3:24 PM, armandoxxx wrote: > Hey guys > > I'm working on some dynamic page loading and would like to know how it's > supposed to be done in wicket (6.x) ... without mappings in my application > class. > > The example: > some urls (for example /news, /article, /people) are bind by users (in > admin > console) to a some page ... > /news >> LayoutPage1 > /article >> LayoutPage2 > /people >> LayoutPage1 > this mapping is written in database and not in application class, because > users can set whatever URL and select whatever page to be shown for that > URL. > > I would like know where to put this resolving from URL TO PAGE and how to > render the page ... > > Any help would be appreciated > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-page-from-url-part-without-hardcoded-mapping-in-application-class-tp4663992.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 > >
Re: How to resolve page from url part without (hardcoded) mapping in application class
Thank you ! Regards Armando -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-page-from-url-part-without-hardcoded-mapping-in-application-class-tp4663992p4663995.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
How to resolve page from url part without (hardcoded) mapping in application class
Hey guys I'm working on some dynamic page loading and would like to know how it's supposed to be done in wicket (6.x) ... without mappings in my application class. The example: some urls (for example /news, /article, /people) are bind by users (in admin console) to a some page ... /news >> LayoutPage1 /article >> LayoutPage2 /people >> LayoutPage1 this mapping is written in database and not in application class, because users can set whatever URL and select whatever page to be shown for that URL. I would like know where to put this resolving from URL TO PAGE and how to render the page ... Any help would be appreciated -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-page-from-url-part-without-hardcoded-mapping-in-application-class-tp4663992.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