• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Michael Decker
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic