
Signature
PGP key posted on website ... http://www.lmert.com/people/davidl/
> What is the purpose of javax.servlet.http.HttpServlet.getPathInfo()?
If the URL to your servlet is e.g.
http://www.example.com/path/to/servlet/MyServlet
the servlet will also be called if you use the URL
http://www.example.com/path/to/servlet/MyServlet/something/else.txt
In that case the Path-Info is
/something/else.txt
> with a web-browser, I need the relative path "x/y/z/a.txt". However,
> getPathInfo() always returns an empty string. Is there some other method
> I should use instead? Is it possible to do this?
Without trying myself: Look into
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html
There are a couple of methods and I think getContextPath should
return the part you need.
Another way would be getRequestURL and take the part for yourself.
Regards, Lothar

Signature
Lothar Kimmeringer E-Mail: spamfang@kimmeringer.de
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
Always remember: The answer is forty-two, there can only be wrong
questions!
as4109@wayne.edu - 11 Oct 2006 09:21 GMT
Lothar Kimmeringer ha escrito:
> > What is the purpose of javax.servlet.http.HttpServlet.getPathInfo()?
>
[quoted text clipped - 5 lines]
> In that case the Path-Info is
> /something/else.txt
Thanks for the attempted advice. Here is what I did to solve it: I
changed
<url-pattern>/</url-pattern>
to
<url-pattern>/*</url-pattern>
I'm not sure if this behavior is specific to Tomcat, but it appears
that, if the url-pattern only partially matches, the servlet still
gets called, but PATH_INFO will not contain any unmatched path
components up to the query string.