• 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

request.getPathInfo()

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
When attempting a request.getPathInfo() from within a JSP, I encounter an
"Error: 404 File Not Found /CatalogMain.jsp/extra/info"
Here's the sample URL:
http://localhost:8080/CatalogMain.jsp/extra/info?category=0

Here's the Expression:
<p>PathInfo(): <%= request.getPathInfo()%></p>

I expected the previous expression to return "/extra/info"
Any suggestions?
Thanks in advance,
Mike Cronin
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi mike,
i observed the same thing. the reason it doesn't work is i guess as follows,
-the JSP file gets converted into a servlet in the backend when requested for the first time and then that servlet is used to serve future requests
-the servlet name given to the JSP's generated servlet is webserver specific
-the getPathInfo() works ONLY when we access a servlet as we might assume from the following quote from servlet/jsp api,
"Returns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string. This method returns null if there was no extra path information. "
-as we DON'T access the servlet generated by the JSP we are not able to use getPathInfo() in JSP the way we do in servlets.
well, this is a limitation but we can always get around it by passing the same information as querystring or something...though that entails changing of the currently working code if we have one...
regards
maulin
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi mike,
actually it works for me on iPlanet4.1 ES and DOESN'T work on Tomcat4.0.5 so i tried to guess the plausible reason but i would say it is a webserver specific thing...
regards
maulin
 
Everyone is a villain in someone else's story. Especially this devious tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic