You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rodrigo Avila <rd...@gmail.com> on 2005/02/11 02:15:34 UTC

Relative Path in web.xml

Hi,

is possible to make a Propertie, in the web.xml file, poiting to a
file using the relative path of the file? Something like:

propertie: fooProp
value: conf/file.txt (file.txt is in $CATALINA_HOME/conf directory, or
/usr/local/tomcat/conf)

Thanks the help!

-- 
Rodrigo de Avila
rdeavila@gmail.com

http://www.avila.eti.br

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Relative Path in web.xml

Posted by Rodrigo Avila <rd...@gmail.com>.
Ok, but in getResourceAsStream()  i need to pass a String with the
name of the file, right? But, is the path/name of the file I store in
an parameter in web.xml... and I get this name again using
config.getInitParameter( "nameOfTheFile" ). For now, I use the
full-path in the "nameOfTheFile" parameter in web.xml... but, how I
can use just an relative path in this parameter?

Sorry if I misundestood... my english is very poor.

Thanks again!


On Fri, 11 Feb 2005 06:35:51 -0500, Tim Funk <fu...@joedog.org> wrote:
> If you wish to load a file relative to the context root of your webapp - look
> at ServletContext.getResourceAsStream()
> 
> -Tim
> 
> Rodrigo Avila wrote:
> > Hi,
> >
> > is possible to make a Propertie, in the web.xml file, poiting to a
> > file using the relative path of the file? Something like:
> >
> > propertie: fooProp
> > value: conf/file.txt (file.txt is in $CATALINA_HOME/conf directory, or
> > /usr/local/tomcat/conf)
> >
> > Thanks the help!
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

-- 
Rodrigo de Avila
rdeavila@gmail.com

http://www.avila.eti.br

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Relative Path in web.xml

Posted by Tim Funk <fu...@joedog.org>.
If you wish to load a file relative to the context root of your webapp - look 
at ServletContext.getResourceAsStream()

-Tim

Rodrigo Avila wrote:
> Hi,
> 
> is possible to make a Propertie, in the web.xml file, poiting to a
> file using the relative path of the file? Something like:
> 
> propertie: fooProp
> value: conf/file.txt (file.txt is in $CATALINA_HOME/conf directory, or
> /usr/local/tomcat/conf)
> 
> Thanks the help!
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org