解决乱码问题

来源:互联网 发布:淘宝收获地址怎么改 编辑:程序博客网 时间:2024/06/06 04:57

post

request.setCharacterEncoding("utf-8")

在web.xml配置过滤器

get

new String(aa.getByte("iso-8859-1"),"utf-8") 进行编解码

或者修改tomcat下面的server.xml 中

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

添加:URIEncoding="UTF-8"

原创粉丝点击