hi,
thanks for your hints, but still I didn't get it to work. I have a
RootRequestMapper that extends MountedMapper, and it overrides mapRequest()
like so
@Override
public IRequestHandler mapRequest(Request request) {
List<String> segments = request.getUrl().getSegments();
if(CollectionUtils.isEmpty(segments)) {
System.out.println("mapRequest to Index page");
return new RenderPageRequestHandler(new
PageProvider(IndexPage.class));
}
else {
System.out.println("mapRequest to Another page");
return new RenderPageRequestHandler(new
PageProvider(AnotherPage.class, new PageParameters().add("param",
segments.get(0))));
}
}
Now, with this in Application:
mount(new RootRequestMapper("/", Index.class));
mount(new RootRequestMapper("b", AnotherPage.class));
mount(new RootRequestMapper("c", AnotherPage.class));
Result: / ends up correctly in IndexPage, but /b and /c end up serving an
empty HTML page (?!).
If I only put this in Application (without the root mapping)
mount(new RootRequestMapper("b", AnotherPage.class));
mount(new RootRequestMapper("c", AnotherPage.class));
Result: / serves an empty page, and /b does end up in AnotherPage, but
renders this in the address bar: /c?param=c (again, replacing b with c, and
now adding the param as a visible url parameter).
Then I tried using a 'wildcard' like this
mount(new RootRequestMapper("/", Index.class));
mount(new RootRequestMapper("/${param}", AnotherPage.class));
Result: / serves correctly the index page, /b serves an empty HTML page.
In all cases, the System.outs in my RootRequestMapper correctly say either
"to Index page" or "to Another page" -- even in those cases above where a
blank HTML page is served, though constructor of said pages is not invoked
then.
So I guess I'm missing some small but essential detail somewhere .. if you
would have any further advice, thanks very much, in advance.
Kind regards
Heikki Doeleman
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Mounting-external-pages-to-root-tp3890756p3990222.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]