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 - [EMAIL PROTECTED]
Author of Java Developer's Guide to Servlets and JSP
ISBN 0-7821-2809-2