Fourth, internationalization
In the form.jsp in the fifth section of the previous section, the customer in Taiwan is more like "please enter your name", and American customers like "please input your name", we can pass international End to meet their needs.
We first create a three area related resource files in WebApp / Web-INF / CLASSES. Chinese Simplified Edition:
# Localstrings_zh_cn.properties
Page.title = Internationalization
Form.Label = Please enter your name
Form.Button = Submit
Chinese traditional version:
# Localstrings_zh_tw.properties
Page.title = Internationalization
Form.Label = Please enter your name
Form.Button = Submit
English version:
# Localstrings_tw.properties
Page.title = INTERNATIONALIZATION
Form.Label = please enter your name
Form.Button = SUBMIT
Localstrings_zh_cn.properties, localstrings_zh_tw.properties and localstrings_tw.properties These three files are saved in system default encoding. Form.jsp is changed:
<% @ Page ContentType = "Text / HTML; Charset = UTF-8"%>
<% @ Page Import = "Beans.localestrings"%>
<% Localstrings lss = new localstrings ("localstrings", request.getlocale ());%>
hEAD>