繁体中文
设为首页
加入收藏
当前位置:JSP技术首页 >> 资料/其它 >> JSTL+Spring+Hibernate中文乱码问题解决

JSTL+Spring+Hibernate中文乱码问题解决

2005-02-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介: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"));就可以正確的存入繁體中文~~~

责任编辑:admin
相关文章