aspose file tools*
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
Author

resource bundle in struts 2

Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
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


SCJP1.4
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 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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: resource bundle in struts 2