This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Reload Struts property file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Reload Struts property file" Watch "Reload Struts property file" New topic
Author

Reload Struts property file

Manju Na
Greenhorn

Joined: Aug 18, 2011
Posts: 11
Hi,
Is it possible to reload struts property file dynamically without restarting application or server.


Thanks in Advance.
Manju
Orton K Randy
Ranch Hand

Joined: Aug 12, 2011
Posts: 41

No, that's not possible. You'll have to restart the server everytime you make a change as is the case with web.xml or struts-config.xml.


Coderanch, best ever forum on the net. Hands down.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

It is possible in struts 2 but it should be in development mode.

http://struts.apache.org/2.0.11/docs/devmode.html


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Orton K Randy
Ranch Hand

Joined: Aug 12, 2011
Posts: 41

Ah yes, bad I forgot that. Tthe catch is that, resource bundles and struts-config will be reloaded for EVERY user request imposing a huge performance penalty. But then, for development, it's actually cool feature since we don't literally care about performance in the dev phase.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

FYI, It's not going to reload for each any every request Until and unless there is any modification in the resource bundle or struts.xml file. Internally it stores file modification details.
Orton K Randy
Ranch Hand

Joined: Aug 12, 2011
Posts: 41

Mohana Rao wrote:FYI, It's not going to reload for each any every request Until and unless there is any modification in the resource bundle or struts.xml file. Internally it stores file modification details.


You sure of that? I haven't tried that, but the spec NOWHERE mentions like the resources are reloaded only if a modification is done to any of the resources. Not that it matters much to me, but still, wanted to know if that's the case.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

You sure of that? I haven't tried that, but the spec NOWHERE mentions like the resources are reloaded

Proof is here.








 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reload Struts property file
 
Similar Threads
i want to load property file without restarting tomcat
message-resources reload
Properties File Error java.util.Resource Bundle. throw Missing Resource Exception
Force reload of struts-config.xml file?
Property File Reload problem