简介:web.XML中加入:
SetCharacterEncoding org.springframework.web.filter.CharacterEncodingFilter encoding big5
SetCharacterEncoding *.JSP
*-servlet.XML中加入:
org.springframework.web.servlet.v...
web.XML中加入:
SetCharacterEncoding org.springframework.web.filter.CharacterEncodingFilter encoding big5
SetCharacterEncoding *.JSP
*-servlet.XML中加入:
org.springframework.web.servlet.view.JstlView /WEB-INF/JSP/ .JSP text/HTML;charset=big5
*.JSP文件中添加:
<% @page contentType="text/HTML;charset=big5"%>
注:当时我采取以上办法,却仍未能完全解决乱码问题,因为我用的類是extends SimpleFormController,我猜測是在Person person = (Person) cmd;時就已亂碼,經測試果然如此,於是,在其後加了一個處理,person.setPname(new String(person.getPname().getBytes(),"big5"));就可以正確的存入繁體中文~~~