在地址栏传入UTF-8编码的参数到action获取到的全是问号.
过滤器和action里面都设置了request.setCharacterEncoding("utf-8");response.setCharacterEncoding("utf-8");
在jsp页面设置了<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">是不是哪里漏了?或者有冲突?

解决方案 »

  1.   

    action里面的去掉。另外。http://topic.csdn.net/u/20080620/12/ddb10976-c13c-4d41-a3e5-778d44bdb853.html
      

  2.   

    request.setCharacterEncoding("utf-8");response.setCharacterEncoding("utf-8"); 
    去掉
      

  3.   

    1 用POST提交
    2 把你的UTF-8编码的参数,放到 google 搜索一下,看看是不是相同(google是UTF-8)编码
      

  4.   

    楼主在看看是不是你的系统的区域设的是哪里的? 有次我做的也是系统的语言设错了 设了不是中国的了是韩国的 然后老出错 都检查不出来 在把
    response.setContentype("text/html;charset=UTF-8")看看
      

  5.   

    我是通过JavaScript提交的...没有form表单,onchange="JavaScript:..."   地址栏显示为http://localhost:8080/weatherddd/weather.do?method=select&province=%E5%B9%BF%E4%B8%9Cgoogle 搜索的结果也一样action中的request.setCharacterEncoding("utf-8");response.setCharacterEncoding("utf-8"); 也去掉了filter配置也放在第一位了...还是不行...在action中获取到就已经是乱码了
      

  6.   

    GET /weatherddd/weather.do?method=select&province=%E5%90%89%E6%9E%97 HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
    Accept-Language: zh-cn
    UA-CPU: x86
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
    Host: localhost:8080
    Connection: Keep-Alive
    Cookie: JSESSIONID=41DB430817298582F949566A9D4DEBD9HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Content-Type: text/html;charset=UTF-8
    Content-Length: 933
    Date: Sat, 21 Jun 2008 13:21:01 GMT
    消息头显示的也没有问题
      

  7.   

    用这个吧!
     byte [] tt=name.getBytes("ISO-8859-1");
      name=new String(tt,"GBK");  out.println(name);
      

  8.   

    你用url传递参数时么?
    fliter是不处理url的。
    tomcat 中的url编码设置成和你的工程一样。在server.xml里面设置。上网搜以下就好了。