• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Externalising message resource property file in struts 2.x

 
Hemant Thard
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Hemant Thard,

do you need it because you need to reload the properties files on each and every request?
 
Hemant Thard
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just keep your project in development mode on each and every request your properties files will be reloaded automatically.
 
Hemant Thard
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Mohana,

I am not sure what you meant. can you elaborate.
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic