views:

32

answers:

1

Is there something in spring where we can write back to an property file ?

Lets say , that we have a property "reportname=SOME REPORT". If we have a GUI where the user can change it to "reportname=SOME OTHER REPORT".

Then, is there something in spring that can write that value back to the property file ?

Also, is there a xml property file reader?

i.e. Can I pass an xml file in "classpath:filename" for the propertyPlaceHolder.

A: 

I don't know if Spring can actually let you modify the application context configuration file, but if it is that important to persist the value of "reportName" for a given report configuration, let's assume, you should store the report configuration in a database, or use a .properties file instead and populate the report name property value using the init method of the spring bean?

Remember the idea of having a application context configuration file is to set up dependencies prior to running you app.

StudiousJoseph
Yes, Since multiple servers go to same database. It would be nice to be able to change property file on the fly. So each server is configured separately but has same data in database.Would you know if there is a xml file reader version for propertyPlaceHolder ?
Shah Al