• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Paths

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
/catalog/help/feedback.jsp
ContextPath: /catalog
ServletPath: /help/feedback.jsp
PathInfo: null
why Pathinfo is null???
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Ranch Hand
Posts: 5399
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> 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"
 
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


/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
Posts: 5399
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
https://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
Posts: 5399
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic