webwork2 中文問題
1、webwork.properties文件中,添加:webwork.i18n.encoding = GBK它主要是用來設置WebWork UI標簽庫的編碼,如果不設置它將通過System.getProperty("file.encoding")來獲取默認字符編碼。2、velocity.properties文件中,添加:input.encoding=GBKoutput.encoding=GBKdefault.contentType=text/html; charset=GBK它是用來設置.vm頁面的編碼方式3、寫一個Filter,將編碼設置為GBK。詳細請看附件中的SetCharacterEncodingFilter文件和Web.xml的配置。它解決Action數據傳遞時的編碼。4、本文下面的源代碼修改自\webwork\docs\wikidocs\TutorialLesson03.html并解決中文問題SetCharacterEncodingFilter.java
ex02-success.jsp: