• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Externalising message resource property file in struts 2.x

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic