struts2中的乱码问题

来源:互联网 发布:小语种配音软件 编辑:程序博客网 时间:2024/06/02 07:53

 

1>>

 在你的JSP页面上调用java.net.URLDecoder里的decode(String s,String enc) 方法


格式:

<%= URLDecoder.decode(new String(request.getParameter("属性").getBytes(("ISO8859-1"),"UTF-8"),"UTF-8")%>



2>>

在Tomcat服务器的server.xml配置文件中,在

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

添加编码URIEncoding="UTF-8" 


 

原创粉丝点击