File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes [Urgent]Accessing properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "[Urgent]Accessing properties file " Watch "[Urgent]Accessing properties file " New topic
Author

[Urgent]Accessing properties file

Sukh sri
Greenhorn

Joined: Mar 25, 2008
Posts: 3
We have a requirment where we need to access the properties file from various J2EE modules like war , rar , ejb-jar . These modules can modify the properies file. And the modification should be availbale to other modules ....

What will be the good option.
Sukh sri
Greenhorn

Joined: Mar 25, 2008
Posts: 3
Why there were no replies .... is there something missing from the details...

... we came through different approaches like

Using properties file , resource bundle etc .. but , our requirement is that the properties file should be writable
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42952
    
  73
I'm sorry, but you have to be kidding to expect an answer in 30 minutes: PatienceIsAVirtue. You might also usefully read EaseUp and the other tips we have on getting the most out of the Saloon: HowToAskQuestionsOnJavaRanch.
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
An updated properties file is usually available after the application has been redeployed or the server restarted. Consider writing to a database instead.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Sukh sri
Greenhorn

Joined: Mar 25, 2008
Posts: 3
Hi Roger ,

thanks for your reply . But , the information that will go into the property file is about "ports" which does not look good to put them in the database. And also , this config file is to be shared between rar and war files .
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
I don't see why port data cannot be written to a DB.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10296
    
168

Originally posted by Sukh sri:
But , the information that will go into the property file is about "ports" which does not look good to put them in the database.


In addition to what Roger mentioned, property files are in most cases changed during deployment and not dynamically. I second with what Roger mentioned about using database for storing/sharing this information. However, if you are still reluctant in doing this, you can think of having a single common service which will be used by these war,rar etc... to modify/access the properties. Doing this will ensure that the common service is aware of any changes to the properties and will be able to return this changed property.


[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Urgent]Accessing properties file