hi Once the ApplicationResources_language_country.properties are defined we have to make struts aware of them through 1. ActionServlets <init-parameter> tag as follows <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>application</param-name> <param-value>ApplicationResources</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
2. we can make struts aware of these through struts-config.xml file <message-resources parameter="ApplicationResources" />
The question is can an application can contain web.xml application resources as well as struts-config message-resources. what is the differnce between them regards saiprasanna
Hi Prasanna, There is a slight difference. Struts provide internationalization features to a web application means the custom labels in the application can be viewed in different language characters as required by the end user for example a client wan'ts his companies web application to be accessed by English as well as Japanese users. In this case you have to define two different Resource bundle files (.properties) containing english and Japanese language characters and had to map this with your struts-config.xml and the view. Rest everything is being taken care by the struts framework. But in case you wan't to implement the same stuff using web.xml then you need to implement your own customized logic.
Defining Struts message resource bundles through <param-name>application</param-name> in web.xml is deprecated. The preferred method to define them in later versions is in the struts-config.xml file. If you want to define more than one bundle, you can do so as long as you define a key for each resource like this: