This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes dynamic URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "dynamic URL" Watch "dynamic URL" New topic
Author

dynamic URL

Martin Zdarsky
Greenhorn

Joined: Nov 25, 2008
Posts: 9
Hi,

I'm working with servlets and jsp. I'd like to get a virtual url. For example type www.eshop.com/product/XXYY and get info about a product XXYY.
The XXYY is stored in a database and shouldn't be in DD file.

Does DD file allow me to define a section where I would run a servlet which would decided if the URL is valid (after looking into a database).
Also it would be desirable to have this url visible in user's browser.

How can I achieve this?

Thanks,
Martin
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Map a servlet on /product*, let it get the pathinfo by HttpServletRequest#getPathInfo() and handle accordingly.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Bauke Scholtz wrote:Map a servlet on /product*, let it get the pathinfo by HttpServletRequest#getPathInfo() and handle accordingly.


Almost. The mapping shoud be /product/*

Also, "dynamic URL" is not the correct term. You mean "friendly URL" or (not particularly accurate) "RESTful URL".


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamic URL