Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 66677
167
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: 66677
167
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!!
 
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!