tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Brogden <wbrog...@bga.com>
Subject Re: properties
Date Tue, 05 Dec 2000 14:00:32 GMT


andreas ebbert wrote:
> 
> Hi there,
> does anybody know where
> to put property-files for servlets
> so that tomcat finds them?
> I tried to place them in the
> same location as the .class-
> -file but that didn´t work, any
> idea´s?
> 
> regards,
> andreas

If you are going to open a file, you have to use a 
fully qualified path. Use web.xml to pass an initialization
parameter to the servlet giving the absolute path to
the properties file. Here is an example:

    <servlet>
       <servlet-name>saynumb.au</servlet-name>
      
<servlet-class>com.JSPbook.Chap04.NumberSoundServ</servlet-class>
         <init-param>
            <param-name>basepath</param-name>
           
<param-value>c:\\tomcat\\webapps\\Root\\JSPbook\\Chap04\\sounds</param-value>
        </init-param>      
    </servlet> 


-- 
WBB - wbrogden@bga.com
Author of Java Developer's Guide to Servlets and JSP 
ISBN 0-7821-2809-2

Mime
View raw message