• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

PathInfo  RSS feed

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am having problem using PathInfo.

I have a servlet "http://localhost:8080/main/forwarder".

As soon as I try the URL "http://localhost:8080/main/forwarder/myinfo?i=1" I get a 404 Error on Tomcat 5.

Am I doing something wrong? Or there is a problem with my configuration in web.xml?

Regards,
Mac
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you have your servlet mapped?
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Siamak Saarmann:
I have a servlet "http://localhost:8080/main/forwarder".

As soon as I try the URL "http://localhost:8080/main/forwarder/myinfo?i=1" I get a 404 Error on Tomcat 5.



A 404 usually means that there is a problem in the servlet configuration (web.xml). Since the first URL works, it means you have a url-pattern that matches '/forwarder' mapped to your servlet. The latter not working means that you do not have a url-pattern matching '/forwarder/myinfo' mapped in web.xml

Check out the examples at the bea website.
 
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want forwarder to match with any suffix, which you can then retrieve as the path info -- which what I am assuming that you wish to do given the subject line of your post -- you would map the servlet to url pattern /forwarder/*.
[ July 08, 2005: Message edited by: Bear Bibeault ]
 
Siamak Saarmann
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you everyone.

Yes I had mapped the servlet to /forwarder and when I changed it to /forwarder/* it worked.

It's strange that neither of two books I read (Sybex and manning) had mentioned this is needed for PathInfos to work.

Regards,
Mac
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It's strange that neither of two books I read ...



That's why JavaRanch is here.
 
Sharad Agarwal
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:
That's why JavaRanch is here.



Amen!!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!