File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts - internationalization in Action class" Watch "struts - internationalization in Action class" New topic

struts - internationalization in Action class


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

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

In : Customer Search

Action class:

String str = new String("");

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

Consultant, Sima Solutions
I agree. Here's the link:
subject: struts - internationalization in Action class
jQuery in Action, 3rd edition