<f:loadbundle basename= "MESSAGES_ZH_CN" var= "Msgs" appears in JSP
There are similar files such as messages_zh_cn.properties in the SRC directory. Look at the following tutorials and you'll know what these files are and what to do with them.
Part from http://javazheng.iteye.com/blog/766294
1, first, prepare a. properties file for each language. For example, to support English, Chinese, Japanese, English can be messages.properties, Chinese is messages_zh.properties, Japanese is messages_ja.properties and so on.
The file content is in the form of:
Message-key=message-value
Username= User name:
The. properties file must be converted into ASCII format before being packaged and organized in the directory hierarchy and placed in the Web-inf directory. For example, the directory hierarchy of resource files can be:
Web-inf\com\test\resource\messages.properties
Web-inf\com\test\resource\messages_zh.properties
Web-inf\com\test\resource\messages_ja.properties
2, then load the. properties file in the JSP via the f:loadbundle tag, such as loading a resource file with the above hierarchy:
<f:loadbundle basename= "com.test.resource.Messages" var= "msg"/>
Where basename is the location (Com\test\resource) and name (Messages) where the resource file resides. var is the name of the loaded variable. JSF can automatically load a matching resource file based on the user's browser configuration.
Then use H:outputtext to output the page content
Or
You can do it.
In addition, the language required for JSF support requires a configuration similar to the following in Faces-config.xml:
View Plaincopy to Clipboardprint?
<faces-config>
<application>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>zh</supported-locale>
<supported-locale>ja</supported-locale>
</locale-config>
</application>
</faces-config>
<faces-config>
<application>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>zh</supported-locale>
<supported-locale>ja</supported-locale>
</locale-config>
</application>
</faces-config>
This configuration tells the JSF framework, the default language configuration, and which language configurations you need to support.
JSP--F:loadbundle usage