页面里写上
<%request.setCharacterEncoding("gb2312");%>
试试

解决方案 »

  1.   

    还是不行噢!aaa.jsp只需要跳转到另一个页面
    为什么要用<%request.setCharacterEncoding("gb2312");%>试了一下还是运行不出来!
      

  2.   

    用 java.net.URLEncoder.encode(String, String)
    虽然 encode(String) 已经过时,不过 encode(String, String) 还是可以用的
    后一个参数指定编码,你可以试试 UTF-8,UNICODE 和 GB2312,应该有一个可以的。
    编码后的中文肯定不是显示中文,但只要能正确打开页面就对了。另,页面文件最好都用英文名,不要用中文名,而且最好都用小写字母,以免有些服务器要区分大小写的。
      

  3.   

    html的head中加上这句试试
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
      

  4.   

    to: jamesfancy(]边城狂人|James Fancy[)  
    我按您的方法试了:都不可以
    用UTF-8:
    --------------------------------------------------------------
    type Status reportmessage /%E7%AC%AC%E4%B8%80%E7%AB%A0.htmdescription The requested resource (/%E7%AC%AC%E4%B8%80%E7%AB%A0.htm) is not available.
    --------------------------------------------------------------
    用GB2312:
    --------------------------------------------------------------
    type Status reportmessage /%B5%DA%D2%BB%D5%C2.htmdescription The requested resource (/%B5%DA%D2%BB%D5%C2.htm) is not available.
    --------------------------------------------------------------
    用UNICODE:
    --------------------------------------------------------------
    URL: Unable to open location: Could not connect to: http://localhost:8080/%FF%FE%2C%7B%00%4E%E0%7A.htm
    --------------------------------------------------------------还有什么方法没?
      

  5.   

    to redez(临风轻扬) :
    您的方法也是找不到!!好急哦!!
      

  6.   

    你试试这样看看可以吗,
    String str="中文";
    str=new String(str.getBytes("GB2312"),"8859-1");
      

  7.   

    你直接写中文,不进行任何编码呢?
    或者写成中文的 UNICODE 编码如第一章的:"\u7b2c\u4e00\u7ae0.htm"
    看这样行不行 —— 不用程序进行任何编码
      

  8.   

    to:jamesfancy()边城狂人(James Fancy) 
    你说的那个用UNICODE 和不用程序进行任何编码
    运行是一个东西
    错误如下:
    URL: Unable to open location: Could not connect to: http://localhost:8080/, ?.htm不过,我已经试出来了
    很简单
    把2312改成K就可以了,希望关注这些问题再不要有人重蹈复撤了!散分!
      

  9.   

    倒,GB2312 和 GBK 编码应该差不多啊,只是GBK字符集大些吧?