首页 > Web开发 > 详细

2017.6.17 jsp中 get请求的中文乱码问题的解决方法

时间:2017-06-17 16:25:19      阅读:176      评论:0      收藏:0      [点我收藏+]

一般Tocant 的url编码是iso-8859-1(查看tocat/conf/server.xml 中的Connector 节点没有写URIEncoding="xxxxxx") 如下:

      <Connector port="8080" protocol="HTTP/1.1"
              connectionTimeout="20000"
              redirectPort="8443" />

 

最后我这个问题是这么解决:

(1)Tomcat中server.xml中,红色为新加设置

    <Connector  URIEncoding="UTF-8" port="8080" protocol="HTTP/1.1"              connectionTimeout="20000"              redirectPort="8443" />

(2)服务器代码处理编码设置

response.setCharacterEncoding("UTF-8");

(3)html页面

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

2017.6.17 jsp中 get请求的中文乱码问题的解决方法

原文:http://www.cnblogs.com/mojiayi/p/7040340.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!