struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Venkata Phani Kumar" <>
Subject Re: Updating a config(.ini) file in Action class
Date Wed, 06 Dec 2006 07:14:00 GMT
You can get any resource path wich is under context path using
The usage of this method is here,
                String iniFilePath =

you can use the 'iniFilePath' to instatiate FileOutStream, and do what ever
you want.

Hope this will help you out....

Venkata Phanikumar. G
----- Original Message ----- 
From: "chuanjiang lo" <>
To: <>
Sent: Wednesday, December 06, 2006 12:21 PM
Subject: Updating a config(.ini) file in Action class

> Hi all,
> I have this web app that allows user to change the config (.ini) file via
> form. When the user submits the form, it goes into the action class and
> action class is supposed to update the ini file accordingly.
> The ini file is lumped together with my action class.
> FileInputStream in = new FileInputStream("test.ini");
> Properties p = new Properties();
> p.load(in);
> p.setProperty("User name", username);
> p.setProperty("Password", password);
> FileOutputStream("test.ini"), null);
> However the ini file is not updated in the webapp directory.
> if i change FileOutputStream("test.ini"), null); to
> FileOutputStream("c:\\test.ini"), null);
> The test.ini will appear in c:\
> How should i go abt updating the ini file that is together with the
> Appreciate any advice

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message