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
Joined: Feb 15, 2005
Posts: 4864
posted
0
The biggest disadvantage would be that you would be unable to use ActionMessages for validation unless you use MessageResources.
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 ]