• 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

Getting messages.properties dynamically

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I want to get the properties files dynamically for internationalization based on some conditions. How can I do that? Let me explain the scenario a bit. I have an application running different events. Each event has its own properties file for Spanish, Italian languages etc. If I place the properties files in /Events/{eventName}/messages.properties, then, is there any way in Struts to get the required properties file for a specific event dynamically at run time.

Thanks in advance.
 
Fawad Ali
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To explain more precisely. I have two events eventA and eventB. Both have different property files. If I want to visit an action named abc.action with eventA then the Struts tags should take the key, value pair for internationalization from a file at /Events/eventA/messages_fr.properties. If I want to visi the same action (abc.action) with eventB, then the properties file should be read from /Events/eventB/messages_fr.properties.

Basically I want to overwrite the Struts default path for Internationalization which is resources folder right now. Is it possible with Struts and struts tags or not?

BTW, I am using Struts 2.0.
 
Fawad Ali
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi:
Still no reply from anyone . I have, although, looked a bit into the tags and found that can be used to load a customProperties.properties file for internationalization. This is fine but I want the customProperties file name to be dynamic from action class. I am trying to do the following



But it wont load the properties file whose name is stored in the resourceBundle variable in the action class. Any idea how can I set the fileName from action class to this tag?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic