You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Cédric Thiébault <ce...@gmail.com> on 2008/10/20 18:15:34 UTC

@MountPath with same path

Hi,

I want to use REST url for my application using wicketstuff-annotation
but it seems that I can't use the same path for 2 pages.
For example :
- /products for the list of products
  @MountPath(path = "products")
  public class ProductListPage extends Webpage

- /products/5 for the detail of product with id=5.
  @MountPath(path = "products")
  @MountMixedParam(parameterNames = { "id" })
  public class ProductDetailPage extends Webpage

It throws an "WicketRuntimeException: its is already mounted for
BookmarkablePageEncoder" on start up.
I tried to use the patch described in
https://issues.apache.org/jira/browse/WICKET-1534 but it goes to first
page with this path (ie /products displays the product detail page for
id=null).

I also tried:
- /products for the list of products
  @MountPath(path = "products")
  public class ProductListPage extends Webpage

- /products/detail/5 for the detail of product with id=5.
  @MountPath(path = "products/detail")
  @MountMixedParam(parameterNames = { "id" })
  public class ProductDetailPage extends Webpage

but /products/detail/5 displays the list page because the list page
path is a subset of the detail page path.

Dis someone used this kind of urls with Wicket ?

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


Re: @MountPath with same path

Posted by Jörn Zaefferer <jo...@googlemail.com>.
Thats the type of problem where you fight against a basic design
descision. Happens a lot with Hibernate, too, and you always lose one
way or the other...

Jörn

On Tue, Oct 21, 2008 at 5:04 PM, Cédric Thiébault
<ce...@gmail.com> wrote:
>> Jörn
> Yes I could do something like that but I don't really like the idea of
> a unique page that dispatch to panels depending on parameters...
>
>> David
> It throws the same exception with @MountIndexedHybrid:
> org.apache.wicket.WicketRuntimeException: products is already mounted
> for HybridUrlCodingStrategy
>
> I tried to do it without annotations and I have exactly the same
> problems (hopefully):
> mountBookmarkablePage("products", ProductListPage.class);
> mount(new IndexedHybridUrlCodingStrategy("products", ProductDetailPage.class));
>
>
> Cedric
>
>
> On Mon, Oct 20, 2008 at 5:46 PM, David Leangen <wi...@leangen.net> wrote:
>>
>> You can use IndexedHybridUrlCodingStrategy (or something like that... currently writing from [my poor] memory).
>>
>>
>> Cheers,
>> =dml
>>
>>
>>
>>
>>> -----Original Message-----
>>> From: Jorn Zaefferer [mailto:joern.zaefferer@googlemail.com]
>>> Sent: 21 October 2008 06:33
>>> To: users@wicket.apache.org
>>> Subject: Re: @MountPath with same path
>>>
>>>
>>> How about mounting that to just "products" and displaying different
>>> content based on the presence of the parameter? You abstract the
>>> content of both pages into panels and show one or the other based on
>>> the paramter.
>>>
>>> Jörn
>>>
>>> On Mon, Oct 20, 2008 at 6:15 PM, Cédric Thiébault
>>> <ce...@gmail.com> wrote:
>>> > Hi,
>>> >
>>> > I want to use REST url for my application using wicketstuff-annotation
>>> > but it seems that I can't use the same path for 2 pages.
>>> > For example :
>>> > - /products for the list of products
>>> >  @MountPath(path = "products")
>>> >  public class ProductListPage extends Webpage
>>> >
>>> > - /products/5 for the detail of product with id=5.
>>> >  @MountPath(path = "products")
>>> >  @MountMixedParam(parameterNames = { "id" })
>>> >  public class ProductDetailPage extends Webpage
>>> >
>>> > It throws an "WicketRuntimeException: its is already mounted for
>>> > BookmarkablePageEncoder" on start up.
>>> > I tried to use the patch described in
>>> > https://issues.apache.org/jira/browse/WICKET-1534 but it goes to first
>>> > page with this path (ie /products displays the product detail page for
>>> > id=null).
>>> >
>>> > I also tried:
>>> > - /products for the list of products
>>> >  @MountPath(path = "products")
>>> >  public class ProductListPage extends Webpage
>>> >
>>> > - /products/detail/5 for the detail of product with id=5.
>>> >  @MountPath(path = "products/detail")
>>> >  @MountMixedParam(parameterNames = { "id" })
>>> >  public class ProductDetailPage extends Webpage
>>> >
>>> > but /products/detail/5 displays the list page because the list page
>>> > path is a subset of the detail page path.
>>> >
>>> > Dis someone used this kind of urls with Wicket ?
>>> >
>>> > ---------------------------------------------------------------------
>>> > 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
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: @MountPath with same path

Posted by Cédric Thiébault <ce...@gmail.com>.
> Jörn
Yes I could do something like that but I don't really like the idea of
a unique page that dispatch to panels depending on parameters...

> David
It throws the same exception with @MountIndexedHybrid:
org.apache.wicket.WicketRuntimeException: products is already mounted
for HybridUrlCodingStrategy

I tried to do it without annotations and I have exactly the same
problems (hopefully):
mountBookmarkablePage("products", ProductListPage.class);
mount(new IndexedHybridUrlCodingStrategy("products", ProductDetailPage.class));


Cedric


On Mon, Oct 20, 2008 at 5:46 PM, David Leangen <wi...@leangen.net> wrote:
>
> You can use IndexedHybridUrlCodingStrategy (or something like that... currently writing from [my poor] memory).
>
>
> Cheers,
> =dml
>
>
>
>
>> -----Original Message-----
>> From: Jorn Zaefferer [mailto:joern.zaefferer@googlemail.com]
>> Sent: 21 October 2008 06:33
>> To: users@wicket.apache.org
>> Subject: Re: @MountPath with same path
>>
>>
>> How about mounting that to just "products" and displaying different
>> content based on the presence of the parameter? You abstract the
>> content of both pages into panels and show one or the other based on
>> the paramter.
>>
>> Jörn
>>
>> On Mon, Oct 20, 2008 at 6:15 PM, Cédric Thiébault
>> <ce...@gmail.com> wrote:
>> > Hi,
>> >
>> > I want to use REST url for my application using wicketstuff-annotation
>> > but it seems that I can't use the same path for 2 pages.
>> > For example :
>> > - /products for the list of products
>> >  @MountPath(path = "products")
>> >  public class ProductListPage extends Webpage
>> >
>> > - /products/5 for the detail of product with id=5.
>> >  @MountPath(path = "products")
>> >  @MountMixedParam(parameterNames = { "id" })
>> >  public class ProductDetailPage extends Webpage
>> >
>> > It throws an "WicketRuntimeException: its is already mounted for
>> > BookmarkablePageEncoder" on start up.
>> > I tried to use the patch described in
>> > https://issues.apache.org/jira/browse/WICKET-1534 but it goes to first
>> > page with this path (ie /products displays the product detail page for
>> > id=null).
>> >
>> > I also tried:
>> > - /products for the list of products
>> >  @MountPath(path = "products")
>> >  public class ProductListPage extends Webpage
>> >
>> > - /products/detail/5 for the detail of product with id=5.
>> >  @MountPath(path = "products/detail")
>> >  @MountMixedParam(parameterNames = { "id" })
>> >  public class ProductDetailPage extends Webpage
>> >
>> > but /products/detail/5 displays the list page because the list page
>> > path is a subset of the detail page path.
>> >
>> > Dis someone used this kind of urls with Wicket ?
>> >
>> > ---------------------------------------------------------------------
>> > 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
>
>

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


RE: @MountPath with same path

Posted by David Leangen <wi...@leangen.net>.
You can use IndexedHybridUrlCodingStrategy (or something like that... currently writing from [my poor] memory).


Cheers,
=dml




> -----Original Message-----
> From: Jorn Zaefferer [mailto:joern.zaefferer@googlemail.com]
> Sent: 21 October 2008 06:33
> To: users@wicket.apache.org
> Subject: Re: @MountPath with same path
> 
> 
> How about mounting that to just "products" and displaying different
> content based on the presence of the parameter? You abstract the
> content of both pages into panels and show one or the other based on
> the paramter.
> 
> Jörn
> 
> On Mon, Oct 20, 2008 at 6:15 PM, Cédric Thiébault
> <ce...@gmail.com> wrote:
> > Hi,
> >
> > I want to use REST url for my application using wicketstuff-annotation
> > but it seems that I can't use the same path for 2 pages.
> > For example :
> > - /products for the list of products
> >  @MountPath(path = "products")
> >  public class ProductListPage extends Webpage
> >
> > - /products/5 for the detail of product with id=5.
> >  @MountPath(path = "products")
> >  @MountMixedParam(parameterNames = { "id" })
> >  public class ProductDetailPage extends Webpage
> >
> > It throws an "WicketRuntimeException: its is already mounted for
> > BookmarkablePageEncoder" on start up.
> > I tried to use the patch described in
> > https://issues.apache.org/jira/browse/WICKET-1534 but it goes to first
> > page with this path (ie /products displays the product detail page for
> > id=null).
> >
> > I also tried:
> > - /products for the list of products
> >  @MountPath(path = "products")
> >  public class ProductListPage extends Webpage
> >
> > - /products/detail/5 for the detail of product with id=5.
> >  @MountPath(path = "products/detail")
> >  @MountMixedParam(parameterNames = { "id" })
> >  public class ProductDetailPage extends Webpage
> >
> > but /products/detail/5 displays the list page because the list page
> > path is a subset of the detail page path.
> >
> > Dis someone used this kind of urls with Wicket ?
> >
> > ---------------------------------------------------------------------
> > 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: @MountPath with same path

Posted by Jörn Zaefferer <jo...@googlemail.com>.
How about mounting that to just "products" and displaying different
content based on the presence of the parameter? You abstract the
content of both pages into panels and show one or the other based on
the paramter.

Jörn

On Mon, Oct 20, 2008 at 6:15 PM, Cédric Thiébault
<ce...@gmail.com> wrote:
> Hi,
>
> I want to use REST url for my application using wicketstuff-annotation
> but it seems that I can't use the same path for 2 pages.
> For example :
> - /products for the list of products
>  @MountPath(path = "products")
>  public class ProductListPage extends Webpage
>
> - /products/5 for the detail of product with id=5.
>  @MountPath(path = "products")
>  @MountMixedParam(parameterNames = { "id" })
>  public class ProductDetailPage extends Webpage
>
> It throws an "WicketRuntimeException: its is already mounted for
> BookmarkablePageEncoder" on start up.
> I tried to use the patch described in
> https://issues.apache.org/jira/browse/WICKET-1534 but it goes to first
> page with this path (ie /products displays the product detail page for
> id=null).
>
> I also tried:
> - /products for the list of products
>  @MountPath(path = "products")
>  public class ProductListPage extends Webpage
>
> - /products/detail/5 for the detail of product with id=5.
>  @MountPath(path = "products/detail")
>  @MountMixedParam(parameterNames = { "id" })
>  public class ProductDetailPage extends Webpage
>
> but /products/detail/5 displays the list page because the list page
> path is a subset of the detail page path.
>
> Dis someone used this kind of urls with Wicket ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>