现在的位置: 首页 > 综合 > 正文

jsp表单提交中文参数乱码

2017年11月20日 ⁄ 综合 ⁄ 共 207字 ⁄ 字号 评论关闭

tomcat  的server.xml配置文件修改

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

这样get方式的中文参数传递到后台不会乱码。

post方式的中文参数在jsp中使用request.setCharacterEncoding("utf-8");

抱歉!评论已关闭.