aspose file tools*
The moose likes Struts and the fly likes property file dynamic vs static Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "property file dynamic vs static" Watch "property file dynamic vs static" New topic
Author

property file dynamic vs static

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

May i know the property file or resource bundle we use in struts is dymic or static?
In otherwords, can we change value content in property file at runtime without having to restart the server or redeploy?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

Static.


[How To Ask Questions On JavaRanch]
Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Joe Ess wrote:Static.


So if i want to change a button name from "X", which is comming from property file(resource bundle), to "Y". should I restart the server after making changes to value in property file?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

You don't have to restart the server, you have to redeploy your WAR or EAR.
Most servers can detect changes made to files and automatically redeploy. This is a convenience for development purposes. Not for production use.
Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Joe Ess wrote:You don't have to restart the server, you have to redeploy your WAR or EAR.
Most servers can detect changes made to files and automatically redeploy. This is a convenience for development purposes. Not for production use.


May I know how property file get affected at the below mentioned time


compile
run
deploy
publish

want to make changes in the producation but dont want to stop, restart or recompile the server in order to avoid creating any problem to users who are using the web site.


Note: My plan is to make changes to the web site that is being used by across the world by thouseds of users. And the change is-- changing the button name from X to Y, and the button name X is to be changed in the property file only to Y.
Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

you can place you property file on any external location excluded from the application ..


so any changes done in property file does not need any Server start or even redeploy..


Regards ,
Raza


Good luck!!
A small leak can sink a Gigantic ship.>
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

Raza Mohd wrote:you can place you property file on any external location excluded from the application ..
so any changes done in property file does not need any Server start or even redeploy..


Property files don't automatically reload after a change, so you will still need a mechanism to detect changes and update the in-memory copy. Have a look at Apache Commons Configuration.
Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

I tested it with placing the property file on my hard drive and accessing it from the application..
So when i made any changes in property file, the changed Data was fetched by the Application .. it Does not require any Server resart or redeploy ..

I just checked it on my local machine....

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: property file dynamic vs static