怎么解决从表单传过来的汉字都是乱码

我现在有一个post.jsp页面,其中表单对应的Action是PostAction,我现在在post.jsp中设置了
<%response.setContentType("text/html;charset=GBK"); %>
<%request.setCharacterEncoding("GBK"); %>,在PostAction中也做了同样的设置,把request和reponse都设置成了GBK,然后在PostAction中在控制台中输出表单中的项时发现汉字都是乱码。怎么解决呢?

[code="java"]
String name=request.getParameter("name");
name=new String(name.getByte("utf-8"),"GBK")
[/code]
不行的话就再把utf-8换成其他的编码,比如ios-8859-1

url encoding

配置容器的 url encoding
没权限的话改form的methhod为post
也不想的话,自己转内码,最好写在过滤器里

参考资料:
3种解决方式
[url]http://www.china-in-action.com/viewtopic.php?f=23&t=6[/url]

写个过滤器吧 最常见了

你是get提交吧。。你那样设置。 post提交是没有问题的。
get提交时, 容器以容器的编码 来编码 如果用的tomcat 默认的编码是iso-8859-1 在server.xml里面设置编码 或者
下面代码如
String name = request.getPara...("name");
String strName = new String(name.getByte("iso-8859-1"),"GBK");

改tomcat的server.xml 编码变成 URIEncoding="UTF-8"