wood burning stoves 2.0*
The moose likes Struts and the fly likes Specifying a message resource file within the Action class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Specifying a message resource file within the Action class" Watch "Specifying a message resource file within the Action class" New topic
Author

Specifying a message resource file within the Action class

Norman Rozental
Greenhorn

Joined: Dec 24, 2003
Posts: 6
I have a struts config file (a module) with two message-resource definitions:

How do you I specify in the Action class (not the .jsp) to use the resource file using key="aKey"?
I know how to do it in a .jsp, but I am having trouble from the Action class.
Any help would be greatly appreciated.
eNormAce.
Rick Hightower
Author
Ranch Hand

Joined: Feb 20, 2002
Posts: 350
MessageResources resources = this.getResources(request, key);


Rick Hightower is CTO of Mammatus which focuses on Cloud Computing, EC2, etc. Rick is invovled in Java CDI and Java EE as well. linkedin,twitter,blog
Norman Rozental
Greenhorn

Joined: Dec 24, 2003
Posts: 6
Cheers Rick! Yep, worked like a treat! Thanks for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Specifying a message resource file within the Action class
 
Similar Threads
???en_US.errors.required??? instead of fileds names
Multiple Message Resource File Problem
Getting values from properties in validate-using multiple message-resources in struts
need a help on Struts ActionMessage
How to access a (non default) resource bundle from .jsp