DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3790>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3790

getRealPath returns context path twice

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From [EMAIL PROTECTED]  2001-09-24 08:21 -------
Tomcat is behaving the way the documentation says to act.  The argument you pass
to getRealPath() should be relative to the *context*, not to the *server*.  The
way to get the answer you want is like this:

  String relative = request.getServletPath();
  if (request.getPathInfo() != null)
    relative += request.getPathInfo();
  String realPath = getServletContext().getRealPath(relative);

or run your application as the ROOT web-app, in which case context-relative and
server-relative paths are the same.

Reply via email to