• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dynamic URL

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Map a servlet on /product*, let it get the pathinfo by HttpServletRequest#getPathInfo() and handle accordingly.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 knew I would regret that burrito. But this tiny ad has never caused regrets:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic