I believe this code is portable in different environments.  Work in mine!

Properties props = new Properties();
InputStream inputStream = getClass().getResourceAsStream(
"/your_file.properties" );

// load the properties file
try
{
        props.load( inputStream );
}
catch ( IOException e )
{
        // handle IO error
}

String value_you_want_to_get = props.getProperty(
key_of_value_you_want_to_get );

David

-----Original Message-----
From: Gayathri Palicherla [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 29, 2002 9:54 AM
To: [EMAIL PROTECTED]
Subject: Properties File


Hi Folks,

     Can any one please tell me how to set a properties file and use it in
servlet. in a visual age, websphere environment as well as in weblogic
environment. I did search at archives and google, I didn't get any favorable
results.
or any URL's that explains how to work with properties files is fine too.

Thank You very much,
I appreciate It.

Gayathri.

___________________________________________________________________________
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

___________________________________________________________________________
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