1View usageJSP
L webwork2 uses locale = en_us by default, encoding = ISO-8859-1
L modify webwork. properties to ensureWebwork. locale = zh_cn, Webwork2 will be automatically localized to Chinese
L do not add
<%@ page contentType="text/html; charset=GBK"%>
And
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=GBK">
This will display garbled characters.
L in this way, the Chinese characters can be correctly displayed in the view.
2View usageVelocity
L no need to set
L but there are also problems: Due to the webwork. properties settingWebwork. i18n. Encoding = ISO-8859-1So the ISO encoding is used by default for display in the browser. It looks garbled. You need to select gb2312 encoding in the browser to display Chinese properly (relatively troublesome)
L tried to set webwork. i18n. Encoding = GBK. the browser showed that the encoding was gb2312, but the Chinese character turned into garbled characters (which expert has a good solution ?)