You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Per Newgro <pe...@gmx.ch> on 2012/08/02 13:15:09 UTC

Is there a MountedMapper respecting better matching path names?

Hi,

before i do this myself i would like to ask the community if someone has done this already.

I want to mount pages at these urls:
mountPage("/pages/${color}/advertise", AdvertisePage.class);
mountPage("/pages/${color}/${niceColor}", ColoredPage.class);

But because they both have 3 matching url path segments the first after sorting all available mount mapper wins. But in this case the "almost exact" url "/pages/red/advertise" is referencing the ColoredPage but should the AdvertisePage. Only ordering the mounts is influencing the result. But this is not a good option.

So i would like to know if there is already a library providing my required behavior.

Thanks
Per

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


Re: Is there a MountedMapper respecting better matching path names?

Posted by Martin Grigorov <mg...@apache.org>.
Extend MountedMapper and override its #getCompatibilityScore() to
return the right one depending on the second parameter.

Some people use a dispatcher page: the page receives the initial call
and then depending on the parameters throws RestartResponseException
with the more specific one.

On Thu, Aug 2, 2012 at 2:15 PM, Per Newgro <pe...@gmx.ch> wrote:
> Hi,
>
> before i do this myself i would like to ask the community if someone has done this already.
>
> I want to mount pages at these urls:
> mountPage("/pages/${color}/advertise", AdvertisePage.class);
> mountPage("/pages/${color}/${niceColor}", ColoredPage.class);
>
> But because they both have 3 matching url path segments the first after sorting all available mount mapper wins. But in this case the "almost exact" url "/pages/red/advertise" is referencing the ColoredPage but should the AdvertisePage. Only ordering the mounts is influencing the result. But this is not a good option.
>
> So i would like to know if there is already a library providing my required behavior.
>
> Thanks
> Per
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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