struts2.1乱码问题

来源:互联网 发布:钢铁力量刷钻石软件 编辑:程序博客网 时间:2024/06/09 16:39

DTD: document type definition

method="post" 不乱码,为 get 时乱码

为post 时,不会携带参数

 在tomcat6中,我用表单用get方法提交,但如果其中表单参数有中文,提交后接受到的就为就为乱码, 
 我以前采取的解决方式是打开tomcat的server.xml文件,找到区块,加入如下一行:URIEncoding="utf-8"

Java代码
  1. <Connector   port= "8080 "   protocol= "HTTP/1.1 "    
  2.            connectionTimeout= "20000 "    
  3.            redirectPort= "8443 "   URIEncoding="utf-8"/>  

原创粉丝点击