Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

resource bundle in struts 2

 
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I have 4 virtual host pointing the the same context in tomcat.
I parse the serverName() to set properties for the site. I need to use diffrent resource bundels for the sites.

ie. www.site1.com , www.site1.se , www.site2.com, www.site2.se

The site1.se and com are the same only diffrents is the language. The text on site1 and site2 can be diffrent. How can I set upp resource bundels for this in struts 2?

// Mathias
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This doesn't answer your question directly, but Struts has internationalization (i18n) built in. In a nutshell, it will get the locale and language of the browser making the requests and use the corresponding application resource file. It works like a charm.

I believe it is possible to load the app resources at will, but I think it opens up a whole ton of synchronization problems. I've read a bunch of threads where people try to dynamically load an app resources file to no avail.
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok thanks!

What is the best approach. when user sends request to www.site1.se then there must be swedish text. If www.site1.com english. www.site2.se swedish but it could differ from site1.

Any suggestions?
 
Straws are for suckers. Now suck on this tiny ad!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic