Ok, what happens now when I use application.getRealPath(absPath) where
absPath is a string that contains the absolute path of the file (say,
C:\somePic.jsp) is that the absolute path just gets appended to the
path of the application on the server so it ends up as "C:\Program
Files\Tomcat\webapps\myApp\C:\somePic.jpg which still does not work.
Any ideas on what I can do to fix this?
Andrew Thompson wrote:
> javadev wrote:
> ...
> > I have a java based web application deployed on Apache Tomcat.
> >
> > On one of my JSP pages, I try to display an image, the path of which is
> > an absolute path (say, C:\somePic.jpg) pointing to a location on the
> > server on which the application is deployed. However when I try to
> > access this web page from a different machine, it looks for this image
> > file on the local machine and not the server. How can I specify an
> > absolute path but still make sure that the jsp page is picking up the
> > image from the server and not the local machine on which it is being
> > run?
>
> Uh-huh.. well, to fix that, simply... wait (checks sub.)
>
> Sub: URGENT! ....
>
> Oh.. (checks watch) apparently I'm too late.
> Never mind.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 
>
> [ Look into ServletContext.getRealPath() ]
>
> Andrew T.