Hi!
Use the following code to load the Properties file.
Use either Inputstream or File Stream
InputStream is = null;
try {
is = getClass().getResourceAsStream("/db.properties");
File>");
} catch (Exception e) {
log(e,"Could not locate the properties file");
}
Properties dbprop = new java.util.Properties();
try{
dbprop.load(is);
}catch(Exception e){
System.out.println("error in loading properties" + e.getMessage());
e.printStackTrace();
}
Do Check that the properties file is in ur classpath.
For help on properties file check the java documentation.
----- Original Message -----
From: "Gayathri Palicherla" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 29, 2002 12:54 PM
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