tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajendra Sakpal" <rajendrasakpal.mailingl...@gmail.com>
Subject Re: Specifying relative path for TOMCAT 5.5 ?
Date Thu, 01 Mar 2007 09:48:25 GMT
Am I right to say that "/" refers to the "Tomcat" directory ?

If I mention the file path as "/subscribers.txt", I don't find  the file in
the "TOMCAT" directory once the class is instantiated.

regards,
Rajendra




On 3/1/07, Pid <p@pidster.com> wrote:
>
> Rajendra Sakpal wrote:
> > Hi,
> >
> > I am using TOMCAT 5.5.  I am creating a file in class that is called
> from a
> > JSP.  However, the relative path that I have specified in the class
> doesn't
> > seem to work.  The path that I have used is
> > :"/webapps/Jonathon/WEB-INF/etc/subscriber.txt".
> >
> > Can someone please let me know, what is wrong with the relative path ?
> >
> > thanks in advance,
> > Rajendra
> >
>
> If you start the path with a "/" then it's not relative.
>
> There are functions to help you locate resources on webapp relative paths.
>
> String absolutePath = servletContext.getRealPath( relativePath );
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message