aspose file tools*
The moose likes Struts and the fly likes Struts: Localition with Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts: Localition with "MessageResources Impls": Get only standard message resource " Watch "Struts: Localition with "MessageResources Impls": Get only standard message resource " New topic
Author

Struts: Localition with "MessageResources Impls": Get only standard message resource

Michael Decker
Greenhorn

Joined: Feb 19, 2003
Posts: 1
I'm using "MessageResources Impls" (http://sourceforge.net/project/showfiles.php?group_id=49385&package_id=76369) to get my message resources out of my database.... I've used this Instruction to install: http://wiki.apache.org/struts/StrutsMessageResourcesFromDatabase

But now, i get only the default messages... if I set with setLocale(Locale.GERMAN) (at Action-Class), it doesn't change anything... I've testet some cases... Default value of getLocale() is de_DE, if I delete the default message in my db, so I get an exeption, that struts misses message....

It's saved as:

I've generated debug output... Perhaps that could be tell anybody anything:



I don't understand my fault...

I thank you very Much!

Mike
la phon
Greenhorn

Joined: Apr 02, 2003
Posts: 5
you must store the locale in session.
you must do something like this:
request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY,new Locale("du") );

MessageResource will read from the session Locale..
 
 
subject: Struts: Localition with "MessageResources Impls": Get only standard message resource