wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Paths Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Paths" Watch "Paths" New topic
Author

Paths

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
/catalog/help/feedback.jsp
ContextPath: /catalog
ServletPath: /help/feedback.jsp
PathInfo: null
why Pathinfo is null???
Sam Cala
Ranch Hand

Joined: Jan 03, 2001
Posts: 147
request.getPathInfo() gives you any extra path information if supplied with the URL, e.g.,
http://localhost/scwcd/servlet/someServlet/Flag=true
calling request.getPathInfo() will give you :
'/Flag=true'
which may be useful as querystring parameter but if a real querystring (paramters) are passed along with extra path info also than also its going to return you the same result, i.e., '/Flag=true'
best wishes,


Best wishes,
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
but if you have mapped your servlet then it gives 404 error.
so does it mean it can not be used with servlet mapping ?
CMIW
TIA


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Paul Jonestone
Greenhorn

Joined: Jun 24, 2002
Posts: 2
> but if you have mapped your servlet then it
> gives 404 error. so does it mean it can not be
> used with servlet mapping ?
Not if you map your servlet with wildcards like
<url-pattern>/servlet/testServlet/*</url-pattern>
This also works in tomcat 4.0.1 without any wildcards. This is allowed according to the 2.3 servlet specification (p.76)
"A servlet container is allowed to make other implicit mappings as long as the explicit mappings take precedence"
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055

/catalog/help/feedback.jsp
ContextPath: /catalog
ServletPath: /help/feedback.jsp
PathInfo: null
why Pathinfo is null???

Because *.jsp is actually mapped to a special servlet. (*.jsp is considered a servlet mapping)
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
Originally posted by Anthony Villanueva:

Because *.jsp is actually mapped to a special servlet. (*.jsp is considered a servlet mapping)

Actually pathInfo is string between queryString and servletName
http://localhost:8050/examples/servlet/HelloWorldRK/pathInof?name=more
pathInof is pathInfo, it could have been anything.
http://www.coderanch.com/t/165634/java-Web-Component-SCWCD/certification/session-listeners here I have posted a sample program. Run that program at your m/c with this URL http://localhost:8050/examples/servlet/HelloWorldRK/pathInof?name=more
CMIW
HTH
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
Originally posted by Paul Jonestone:
> but if you have mapped your servlet then it
> gives 404 error. so does it mean it can not be
> used with servlet mapping ?
Not if you map your servlet with wildcards like
<url-pattern>/servlet/testServlet/*</url-pattern>
This also works in tomcat 4.0.1 without any wildcards. This is allowed according to the 2.3 servlet specification (p.76)
"A servlet container is allowed to make other implicit mappings as long as the explicit mappings take precedence"

I think it look for servlet word to extract pathInfo.
CMIW
TIA
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Paths
 
Similar Threads
javax.servlet.forward.path_info
doubt regarding mapping request URI
getQueryString()
Tomcat error HTTP Status 500 -(JSP page error (Unable to compile class for JSP )
request.getPathInfo() returns null