• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic URL

 
Martin Zdarsky
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Map a servlet on /product*, let it get the pathinfo by HttpServletRequest#getPathInfo() and handle accordingly.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64716
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic