Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MessageResources VS ResourceBundle

 
Dan Howard
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

For building apps using internationalization I can use MessageResources in struts but it's likely that parts of my app which may require translation are not really in the web layer. For example console utilities and Swing.

So I'm thinking of not using MessageResources and instead use ResourceBundle since it's a common class in java.util.

Are any major disadvantages in using ResourceBundle over MessageResources?

TIA
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The biggest disadvantage would be that you would be unable to use ActionMessages for validation unless you use MessageResources.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Presentation tier - Struts part of application

Business tier- POJO or EJB Business model part of application

Integration tier - Relational Database, Web Services, File system, EIS


Are any major disadvantages in using ResourceBundle over MessageResources?


Use both. Struts is only for the View and Controller portion of a MVC-based application. So, org.apache.struts.util.MessageResources should be used only in the Presentation tier (in the web interface component)

Use a ResourceBundle for language translation needs in the Model, aka business application.

P.S. No business logic goes in the Struts Action subclasses.
[ July 09, 2008: Message edited by: James Clark ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic