I want to achieve the following using Apache Wicket.
We have the requirement that the URL /xxxx can display one of two things.
These are quite distinct pages, with hundreds of lines of various wicket components and so on.
Currently we had two different URLs (/city/xxx and /venue/xxx) and they were mapped in the application, and that worked fine. Now they should share a URL.
I need to have some kind of logic like "select id from city where url_name=?" and if there is a row display the CityDetailPage, else if "select id from venue where url_name=?" then VenueDetailPage, otherwise 404.
Things I've considered:
Thanks in advance! I am quite stuck :(
I'd recommend to use custom IProvider
, i.e. instead of mountPage("the/path", VenuePage.class)
do mount(new MountedMapper("the/path", new MyClassProvider()))
, where MyClassProvider
implements IProvider
and returns different page class in #get()
depending on your conditions.