There are two ways to achieve what you are looking for:

1) store a stable, unique textual identifier per product (e.g. "Ford-Ranger-Model-2005"), and lookup the product from this identifier 2) store a textual identifier -> ID mapping in your session and do the lookup when the page is accessed; of course this mapping needs to be created at some point in time so the product page can lookup the proper product ID.

Option (2) is rather clumsy as it requires a session for a url that looks stateless/bookmarkable. Also, you cannot get around the fact that you need to be able to identify the product somehow.

I'd suggest you take a close look at option (1).

In general "sending it behind the scenes" is impossible in the way you are thinking about it. How would you handle the case that the user bookmarks said item-url, and instead of going to your list page goes to the product page directly? That way the only contextual information you have is what is in the url.

Good luck.

Bas

----- Original Message ----- From: "Henrique Boregio" <hbore...@gmail.com>
To: <users@wicket.apache.org>
Sent: Thursday, December 16, 2010 4:05 PM
Subject: URL coding strategies


Hello, I am mounting my URLs so I can list product items like so:
http://www.mysite.com/item/id/0
http://www.mysite.com/item/id/1

and so on...then I user this id param to fetch the data from the database.

I am not accesing this page directly. I have another page where the
items are fully listed (the item's title, description, price, etc) and
when the user click on each item, they are redirected to this /item/id
page.

Is there a way to avoid exposing the item's id, but send it "behind
the scenes" to the next page, so I would have something like:
http://www.mysite.com/item/ITEM_TITLE
eg. http://www.mysite.com/item/Ford-Ranger-Model-2005

In other words, I'm still using the item's id to fetch it from the
database, but the URL shows an SEO friendly version.

Thanks.

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




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

Reply via email to