Get Post乱码

阅读更多

get乱码
方法1(麻烦): new String(name.getBytes("iso8859-1"),"utf-8");
方法2: 在server.xml中增加URIEncoding="UTF-8"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>
post乱码
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");

你可能感兴趣的:(jsp)