aspose file tools*
The moose likes Struts and the fly likes Externalising message resource property file in struts 2.x Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Externalising message resource property file in struts 2.x" Watch "Externalising message resource property file in struts 2.x" New topic
Author

Externalising message resource property file in struts 2.x

Hemant Thard
Ranch Hand

Joined: Dec 23, 2008
Posts: 122
Hi Guys,

I am pretty new in struts and is making an application where I want to externalize my message resource property file in struts.
like my application property file is outside of my war file(in my C: drive), how can i configure my struts application to use the same.



Regards,
-Hemant.
debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

hi Hemant Thard,

do you need it because you need to reload the properties files on each and every request?
Hemant Thard
Ranch Hand

Joined: Dec 23, 2008
Posts: 122
hi debraj ,

Thanks for the reply.
no i want to keep my messaage resources property file outside of war file.
it will be helpful to me when i want to add new language to my application without restarting my server.

Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Just keep your project in development mode on each and every request your properties files will be reloaded automatically.


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.
Hemant Thard
Ranch Hand

Joined: Dec 23, 2008
Posts: 122
hi Mohana,

I am not sure what you meant. can you elaborate.
debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

check out http://struts.apache.org/2.x/docs/devmode.html
put struts.i18n.reload = true in your struts.properties along with struts.devMode = true
Hemant Thard
Ranch Hand

Joined: Dec 23, 2008
Posts: 122
thanks for the reply

but i dont want to reload my message file on each and every request.

here's what i am trying to do.

i have language drop down whose value comes from DB. when new language is to be added, an entry is made on that table. so i want to externalize my message resource prop file, so that i just have to keep my message resource file on that folder and my application will pick up that file. no need to restart your server.

I hope i am clear.
debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Externalising message resource property file in struts 2.x