Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

resource bundle in struts 2

 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • 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
 
Dom Lassy
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic