I am using the properties file. Here is my code sample

            Properties m_properties = new Properties();
            URL url=new URL("http://localhost/isc/res/ndm.props");
            InputStream istream=url.openStream();
            m_properties.load(istream);
            istream.close();

try this, URL should point to your props file. If you need you can use
File() method rather than URL

raghu
-----Original Message-----
From: Greg Schueler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 12:18 PM
To: [EMAIL PROTECTED]
Subject: RE: properties files and tomcat


You should do this:

Properties myprops = new Properties();
myprops.load(new FileInputStream(new File("my.properties")));

if this doesn't seem to work, make sure that my.properites is in the right
place, and/or qualify the new File() call.

e.g.
....new File("d:\tomcat\webapps\myapp\my.properties");

The CLASSPATH is only for loading class files, and will not help you find
the properties file.

-----Original Message-----
From: Christoph Rooms [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 11:24 AM
To: [EMAIL PROTECTED]
Subject: properties files and tomcat


Hi,

I want to read a properties file like this :

Properties.class.getResourceAsStream("my.properties");

This function should find the properties files when it's in the CLASSPATH.

I have putted the properties file in the WEB-APPS dir ...

anyone ?

thanks ...Christoph

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to