日期:2014-05-17  浏览次数:20707 次

在jsp传值到struts1.3时,出现乱码怎么解决?
tomcat已经修改了编码:
<Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000" URIEncoding="UTF-8"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--

项目中加了过滤器:
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOExceptionServletException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");

chain.doFilter(request, response);
}

jsp页面也是UTF-8的格式,但还是出现乱码,怎么解决?

------解决方案--------------------
引用:
response.setContentType("text/html; charset=utf-8"); 

+1
------解决方案--------------------
乱码 : 页面字符编码, 项目设置的字符编码 、 Tomcat 乱码 、 数据库乱码 。 就这几个 。 都统一下!