Meaningless Drivel is fun!
The moose likes Struts and the fly likes resource bundle in struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "resource bundle in struts 2" Watch "resource bundle in struts 2" New topic

resource bundle in struts 2

Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367

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. , ,,

The 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

Joined: May 05, 2006
Posts: 181
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

Joined: Aug 21, 2004
Posts: 367
ok thanks!

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

Any suggestions?
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: resource bundle in struts 2
It's not a secret anymore!