You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Korbinian Bachl <ko...@whiskyworld.de> on 2018/04/11 07:47:03 UTC

manual resolving of path

Hi,

where would I need to look at if I wanted to resolve the path from the root of the webapplication inside a wicket application root?


e.g.: domain.com <- has wicket app on ROOT deployed
domain.com/foo <- path mapped to foo-webpage
domain.com/foo/bar <- I now want to get the request not resolved by foo-webpage but by my own custom resolver-webpage but I cant map this as usual as the mapping comes from a DB and can change anytime
domain.com/bar2 <- I also want to hijack this one temporary even we have a page mounted to /bar2

Any idea how I might "hijack" the request and resolve it to another page?

Best,

KB

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: manual resolving of path

Posted by Korbinian Bachl <ko...@whiskyworld.de>.
Hello Bas,

thank you very much - that really led me to what I needed.

Best,

KB

----- Ursprüngliche Mail -----
> Von: "Bas Gooren" <ba...@iswd.nl>
> An: users@wicket.apache.org, "Korbinian Bachl" <ko...@whiskyworld.de>
> Gesendet: Mittwoch, 11. April 2018 11:01:58
> Betreff: Re: manual resolving of path

> Hi,
> 
> This is actually relatively simple!
> 
> Steps:
> 
>   - Create a mapper for this which extends AbstractMapper
>   - Return a compatibility score which is higher than other mappers if you
>   want to override them (e.g. return Integer.MAX_VALUE)
>   - Implement mapRequest() to resolve the url to a RenderPageRequestHandler
>   - Implement mapHandler() to resolve a handler for your target page class
>   to a url (e.g. check for IPageClassRequestHandler and use provided page
>   parameters to build url)
>   - Mount your custom mapper in your application’s init() method
> 
> Done!
> 
> Met vriendelijke groet,
> Kind regards,
> 
> Bas Gooren
> 
> Op 11 april 2018 bij 09:47:16, Korbinian Bachl (
> korbinian.bachl@whiskyworld.de) schreef:
> 
> Hi,
> 
> where would I need to look at if I wanted to resolve the path from the root
> of the webapplication inside a wicket application root?
> 
> 
> e.g.: domain.com <- has wicket app on ROOT deployed
> domain.com/foo <- path mapped to foo-webpage
> domain.com/foo/bar <- I now want to get the request not resolved by
> foo-webpage but by my own custom resolver-webpage but I cant map this as
> usual as the mapping comes from a DB and can change anytime
> domain.com/bar2 <- I also want to hijack this one temporary even we have a
> page mounted to /bar2
> 
> Any idea how I might "hijack" the request and resolve it to another page?
> 
> Best,
> 
> KB
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: manual resolving of path

Posted by Bas Gooren <ba...@iswd.nl>.
Hi,

This is actually relatively simple!

Steps:

   - Create a mapper for this which extends AbstractMapper
   - Return a compatibility score which is higher than other mappers if you
   want to override them (e.g. return Integer.MAX_VALUE)
   - Implement mapRequest() to resolve the url to a RenderPageRequestHandler
   - Implement mapHandler() to resolve a handler for your target page class
   to a url (e.g. check for IPageClassRequestHandler and use provided page
   parameters to build url)
   - Mount your custom mapper in your application’s init() method

Done!

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 11 april 2018 bij 09:47:16, Korbinian Bachl (
korbinian.bachl@whiskyworld.de) schreef:

Hi,

where would I need to look at if I wanted to resolve the path from the root
of the webapplication inside a wicket application root?


e.g.: domain.com <- has wicket app on ROOT deployed
domain.com/foo <- path mapped to foo-webpage
domain.com/foo/bar <- I now want to get the request not resolved by
foo-webpage but by my own custom resolver-webpage but I cant map this as
usual as the mapping comes from a DB and can change anytime
domain.com/bar2 <- I also want to hijack this one temporary even we have a
page mounted to /bar2

Any idea how I might "hijack" the request and resolve it to another page?

Best,

KB

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org