My eyes too :-)

I was working on absolute urls the other day, and then came along this "pearl". But since you are the one who reported/created WICKET-3347 you've enjoyed the sight of this method before :-)

But back on-topic:
The TS should create a single root mapper which maps AnotherPage.class and handles encoding/decoding of url properly before handing the request off to the rest of the mappers.

TS: Can you link to e.g. pastebin and put the RootMapper you built online there?

Op 4-11-2011 14:37, schreef Martin Grigorov:
On Fri, Nov 4, 2011 at 3:17 PM, Bas Gooren<b...@iswd.nl>  wrote:
The latter problem is logical: your mapping is focused on incoming requests.
When wicket renders a link to AnotherPage.class, which url should be
generated?

My guess is that a request for /b comes in, wicket then checks if the url is
valid for AnotherPage.class by generating a url for it, which is /c (*).

*) See WebPageRenderer#respond(RequestCycle).
my eyes bleed when I look in this method :-)

Simply put: you need to properly handle url generation, too :-)

Op 4-11-2011 13:53, schreef heikki:
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



Reply via email to