欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Get Post乱码

程序员文章站 2022-07-08 16:01:45
...

get乱码
方法1(麻烦): new String(name.getBytes("iso8859-1"),"utf-8");
方法2: 在server.xml中增加URIEncoding="UTF-8"
<Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>
post乱码
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
相关标签: jsp