Let me try that again....

I think you could use the requestURI() method of the
HttpServletRequest object and pass that to
ServletContext.getRealPath().
 
Example:

<% out.println(application.getRealPath(request.getRequestURI())); %>

Output for the following request to the above code: 

Request: http://localhost:8080/tomcat-docs/test.jsp

Result:
/files/projects/jakarta-tomcat-4.0/build/webapps/tomcat-docs/tomcat-docs/test.jsp

You have to be careful when using this method. If the deployed application 
is run out of the WAR file (it's not expanded on the filesystem), 
then getRealPath will return null.

> 
> 
> On Mon, 2002-08-26 at 16:17, Mark R. Diggory wrote:
> > Hi,
> > 
> > I'm trying to write a Tag that knows the absolute file path of the JSP 
> > Page it is executing in (Not the request.getServletPath(), which could 
> > actually just be a servlet mapping) does anyone have any tips on how to 
> > get this in Tomcat? I was actually looking throught the actuall Catalina 
> > code base and came across a class org.apache.catalina.Globals which 
> > suggests that there are references to to things like (jsp-file, 
> > servlet-path) from the web.xml present in the request sttributes. But I 
> > fail to see them.
> > 
> > -Mark
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> > 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to