This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic URL

 
Martin Zdarsky
Greenhorn
Posts: 9
  • 0
  • 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
  • 0
  • 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: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • 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".
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic