aspose file tools*
The moose likes Servlets and the fly likes Getting extra path info Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Getting extra path info" Watch "Getting extra path info" New topic
Author

Getting extra path info

Nitin Dubey
Ranch Hand

Joined: Oct 30, 2000
Posts: 126

Hello,

Suppose :
http://localhost:8080/mycontext/MyServlet/ExtraPathInfo
Where "MyServlet" is the actual servlet.

How can I get the Extra Path Info ? When I try with this URL the tomcat container looks for servlet with name "ExtraPathInfo" and not "MyServlet" which is the obvious behaviour.

Is there any configuration related thing that I need to take care of ?

Waiting for replies,


Nitin Dubey
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

You need to define the mapping as /MyServlet/*, and maybe /MyServlet/ depending on your requirements.
Nitin Dubey
Ranch Hand

Joined: Oct 30, 2000
Posts: 126

Thanx. that worked
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312

Suppose :
http://localhost:8080/mycontext/MyServlet/ExtraPathInfo
Where "MyServlet" is the actual servlet.

How can I get the Extra Path Info ?


Use request.getPathInfo()..
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

request.getURI()

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequest.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Getting extra path info
 
Similar Threads
ContextPath vs ServletPath
Calling "/servlet/MyServlet" from HTML form
Extra Path Info weirdness
welcome file for virtual/logical path
Running servlet in tomcat