You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marcel Barbosa Pinto <ma...@gmail.com> on 2016/01/13 18:04:02 UTC

URL Mapping with dynamic params

Hi guys,

I have to mount a page with an URL that contains zero or more "categories".

/page/${id}
/page/vahicles/${id}
/page/vahicles/cars/${id}
/page/vahicles/cars/honda/${id}


The "/page" is fixed while the others vehicles, cars and honda is like a
category tree only for SEO needs.

In a rewrite framework I can create a regex for these params.
How can I achieve this in Wicket without fixing the parameters?

Instead of that:

/page/${cat0}/${id}
/page/${cat0}/${cat1}/${id}
/page/${cat0}/${cat1}/${cat2}/${id}

I would like to do something like this pseudo regex:

/page/#{(.+/)?(.+/)?(.+/)?}/${id}


Thanks;

Re: URL Mapping with dynamic params

Posted by Marcel Barbosa Pinto <ma...@gmail.com>.
OK, thank you.
Em 13 de jan de 2016 3:21 PM, "Martin Grigorov" <mg...@apache.org>
escreveu:

> I am not sure.
> I think the id should be also dynamic:
> id = parameters.get(parameters.getIndexedCount() - 1);
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 13, 2016 at 6:17 PM, Marcel Barbosa Pinto <
> marcel.power@gmail.com> wrote:
>
> > Hmm, cool... this will work for me as the last index will always be the
> > ${id}, tks!
> >
> >
> >
> >
> >
> > On Wed, Jan 13, 2016 at 3:08 PM, Martin Grigorov <mg...@apache.org>
> > wrote:
> >
> > > Hi,
> > >
> > > Mount just "page" and use PageParameters indexed parameters to
> read/write
> > > the categories.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Wed, Jan 13, 2016 at 6:04 PM, Marcel Barbosa Pinto <
> > > marcel.power@gmail.com> wrote:
> > >
> > > > Hi guys,
> > > >
> > > > I have to mount a page with an URL that contains zero or more
> > > "categories".
> > > >
> > > > /page/${id}
> > > > /page/vahicles/${id}
> > > > /page/vahicles/cars/${id}
> > > > /page/vahicles/cars/honda/${id}
> > > >
> > > >
> > > > The "/page" is fixed while the others vehicles, cars and honda is
> like
> > a
> > > > category tree only for SEO needs.
> > > >
> > > > In a rewrite framework I can create a regex for these params.
> > > > How can I achieve this in Wicket without fixing the parameters?
> > > >
> > > > Instead of that:
> > > >
> > > > /page/${cat0}/${id}
> > > > /page/${cat0}/${cat1}/${id}
> > > > /page/${cat0}/${cat1}/${cat2}/${id}
> > > >
> > > > I would like to do something like this pseudo regex:
> > > >
> > > > /page/#{(.+/)?(.+/)?(.+/)?}/${id}
> > > >
> > > >
> > > > Thanks;
> > > >
> > >
> >
> >
> >
> > --
> >
> > Marcel Barbosa Pinto
> > 55 11 98255 8288
> >
>

Re: URL Mapping with dynamic params

Posted by Martin Grigorov <mg...@apache.org>.
I am not sure.
I think the id should be also dynamic:
id = parameters.get(parameters.getIndexedCount() - 1);

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jan 13, 2016 at 6:17 PM, Marcel Barbosa Pinto <
marcel.power@gmail.com> wrote:

> Hmm, cool... this will work for me as the last index will always be the
> ${id}, tks!
>
>
>
>
>
> On Wed, Jan 13, 2016 at 3:08 PM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hi,
> >
> > Mount just "page" and use PageParameters indexed parameters to read/write
> > the categories.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Wed, Jan 13, 2016 at 6:04 PM, Marcel Barbosa Pinto <
> > marcel.power@gmail.com> wrote:
> >
> > > Hi guys,
> > >
> > > I have to mount a page with an URL that contains zero or more
> > "categories".
> > >
> > > /page/${id}
> > > /page/vahicles/${id}
> > > /page/vahicles/cars/${id}
> > > /page/vahicles/cars/honda/${id}
> > >
> > >
> > > The "/page" is fixed while the others vehicles, cars and honda is like
> a
> > > category tree only for SEO needs.
> > >
> > > In a rewrite framework I can create a regex for these params.
> > > How can I achieve this in Wicket without fixing the parameters?
> > >
> > > Instead of that:
> > >
> > > /page/${cat0}/${id}
> > > /page/${cat0}/${cat1}/${id}
> > > /page/${cat0}/${cat1}/${cat2}/${id}
> > >
> > > I would like to do something like this pseudo regex:
> > >
> > > /page/#{(.+/)?(.+/)?(.+/)?}/${id}
> > >
> > >
> > > Thanks;
> > >
> >
>
>
>
> --
>
> Marcel Barbosa Pinto
> 55 11 98255 8288
>

Re: URL Mapping with dynamic params

Posted by Marcel Barbosa Pinto <ma...@gmail.com>.
Hmm, cool... this will work for me as the last index will always be the
${id}, tks!





On Wed, Jan 13, 2016 at 3:08 PM, Martin Grigorov <mg...@apache.org>
wrote:

> Hi,
>
> Mount just "page" and use PageParameters indexed parameters to read/write
> the categories.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 13, 2016 at 6:04 PM, Marcel Barbosa Pinto <
> marcel.power@gmail.com> wrote:
>
> > Hi guys,
> >
> > I have to mount a page with an URL that contains zero or more
> "categories".
> >
> > /page/${id}
> > /page/vahicles/${id}
> > /page/vahicles/cars/${id}
> > /page/vahicles/cars/honda/${id}
> >
> >
> > The "/page" is fixed while the others vehicles, cars and honda is like a
> > category tree only for SEO needs.
> >
> > In a rewrite framework I can create a regex for these params.
> > How can I achieve this in Wicket without fixing the parameters?
> >
> > Instead of that:
> >
> > /page/${cat0}/${id}
> > /page/${cat0}/${cat1}/${id}
> > /page/${cat0}/${cat1}/${cat2}/${id}
> >
> > I would like to do something like this pseudo regex:
> >
> > /page/#{(.+/)?(.+/)?(.+/)?}/${id}
> >
> >
> > Thanks;
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288

Re: URL Mapping with dynamic params

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Mount just "page" and use PageParameters indexed parameters to read/write
the categories.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jan 13, 2016 at 6:04 PM, Marcel Barbosa Pinto <
marcel.power@gmail.com> wrote:

> Hi guys,
>
> I have to mount a page with an URL that contains zero or more "categories".
>
> /page/${id}
> /page/vahicles/${id}
> /page/vahicles/cars/${id}
> /page/vahicles/cars/honda/${id}
>
>
> The "/page" is fixed while the others vehicles, cars and honda is like a
> category tree only for SEO needs.
>
> In a rewrite framework I can create a regex for these params.
> How can I achieve this in Wicket without fixing the parameters?
>
> Instead of that:
>
> /page/${cat0}/${id}
> /page/${cat0}/${cat1}/${id}
> /page/${cat0}/${cat1}/${cat2}/${id}
>
> I would like to do something like this pseudo regex:
>
> /page/#{(.+/)?(.+/)?(.+/)?}/${id}
>
>
> Thanks;
>