• 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 path configuration/resolving

 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a strange requirement herem, not sure if I can explain it properly, but let me try - I need to display different set of sites with dyamic paths such as -

http://xyz.com/people/1234/index.do?someparams=pqr
http://xyz.com/people/5678/index.do?someparams=pqr
http://xyz.com/people/1234/photos.do
http://xyz.com/people/5678/photos.do

Now - the NOS here (1234 or 5678) will be generated dynamially and the action will be requested - but they should resolve to the same action say - http://xyz.com/people/index.do?someparams=pqr and the action should also get the requested number in the path. Obviously it is not possible to add configurations for all those dynamic numbers, so there has to be only one action mapped here.

So what I want is this http://xyz.com/people/1234/index.do?someparams=pqr should resolve to http://xyz.com/people/index.do?someparams=pqr and it should also get "1234" as part of the info.

How can I achieve this?? I have not done this before but I think this sort of path manipulation should be possible.

Any pointers, help would be highly appreciated!

TIA,
- Manish
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One possibility would be to create a Servlet Filter. By doing so, you can read the URI, examine it, and then forward to a different URI. So, for example, you could read a URI like
http://xyz.com/people/1234/index.do?someparams=pqr
and then forward to
http://xyz.com/people/index.do?Id=1234&someparams=pqr

For more information on Servlet Filters, see chapter 11 of the Sun J2EE 1.4 Tutorial.
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey, that should help!! Thanks a ton!!!

- Manish
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic