Hi

>I have a properties file (LDAP.properties) from which I want to read
>some properties. The code works fine when I run through a driver
>application, with the file in the current directory. However, when I
>move the LDAP.properties file to WEB-INF/classes and create a .war, and
>deploy it, the servlet throws a FileNotFoundException . I can see the
>LDAP.properties file in the Tomcat
>4.0/webapps/DemoClient/WEB-INF/classes directory (DemoClient being my
>app name)


If you give filename alone, Tomcat searches for the file in the current
folder. If you want to put in  some other folder, set classpath for that
folder and use ClassLoader.getResourceAsStream() method (pass file name as
argument). Use the InputStream returned to read the file.

-saravanan

----------------------------------------------------------------------
P Saravanan
Indo-Fuji Information Technologies Ltd

Phone ++91-80-6784122/33/44  Fax ++91-80-6784646
Email [EMAIL PROTECTED]
----------------------------------------------------------------------

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to