STRUTS MESSAGE RESOURCE
Struts framework has a resource file mechanism that is very useful from first : it can be used as projects shared constant svn, secondly these are used for internationalization. File contains the name value pairs.
When you start your server that the project has been deployed on, the resource file will be ready for you to use. For example you can use them for labels as shown in below
<%@taglib uri="http://jakarta.apache.org/struts/tags-bean"% prefix="bean">
<bean:message key="name" />
This is easy as you can see.
The other function if you have properties file with different names such as
message-de.properties --> contains German
message-tr.properties --> contains Turkishmessage-fr.properties --> contains French
message-bg.properties --> contains Belgium
message_zh.properties --> contains Chinese
these files must be under your resource folder and you should introduce to your project from your struts-config.xml file such as below:
<message-resource parameter="yourfilepath">
Then you can see the different languages depends on the default language setting.
No comments:
Post a Comment