File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts - internationalization in Action class

 
loguKK
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic