[Logo]
Forums Register Login
PathInfo
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
How do you have your servlet mapped?
 

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.
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 ]
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
 

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



That's why JavaRanch is here.
 

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



Amen!!
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database


This thread has been viewed 683 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jan 20, 2019 17:57:46.