You cannot have a seo-friendly url _and_ pass objects. If you want to pass an
object to another page (say a Product), then you need to create a
constructor on the target page which accepts a Product or an
IModel<Product>. You can then call setResponsePage( new TargetPage( product
) ); The upside is that you only query the database once for the product,
but the url is not seo-friendly.
vp143 wrote:
>
> Hi there, I have a question about URL coding strategies
>
>
>
> I have decided to use IndexedParamUrlCodingStrategy for friendly URL's.
>
>
>
> I have set PageParameters for this strategy in the following way:
>
>
>
> PageParameters pageParameters = new PageParameters();
>
> pageParameters.add("0", categoryName);
>
> pageParameters.add("1", productName);
>
>
>
> I have then created a Bookmarkable link like the following:
>
> Link viewItem = new BookmarkablePageLink("viewItem", ProductInfo.class,
> pageParameters);
>
>
>
> What I really want to do is pass the Product object to the ProductInfo
> class
> without it being visible in the URL.
>
> I would rather not have to query the database for data object that I
> already
> have.
>
> How can this be achieved?
>
>
>
> Many thanks in advance.
>
>
>
> Regards
>
> Vishal
>
>
>
--
View this message in context:
http://old.nabble.com/URL-coding-strategies-tp27939290p27944464.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]