wood burning stoves 2.0*
The moose likes Struts and the fly likes struts - internationalization in Action class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts - internationalization in Action class" Watch "struts - internationalization in Action class" New topic
Author

struts - internationalization in Action class

loguKK
Greenhorn

Joined: Jun 19, 2007
Posts: 2
hi all,

i like to implement the struts internationalization message in my Action class ... i have done it in JSP pages... as i am using property file for all the languages .. how to implement in Action Classes..,
Mahima Singh
Greenhorn

Joined: May 16, 2007
Posts: 26
It works in the same way, for eg,

In MessageResource.properties :

Customer.search= Customer Search

Action class:

String str = new String("Customer.search");


In Struts Config:

<message-resources parameter="MessageResource"/>
[ July 04, 2007: Message edited by: Mahima Singh ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The Struts Action class (your actions' superclass) has a getResources() method that returns an instance of MessageResources. Once you have this object, you can use its getMessage() method to retrieve a specific message. For more information, see the Struts JavaDoc


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts - internationalization in Action class