整个页面的字符统一。
用request。setCharacterEncoding();可以的
但是如果强制转换了,就不要用request了,两者都用,就有问题

解决方案 »

  1.   

    我做毕业设计的时候正好遇到这个问题,可惜忘记了具体的做法,好象是在接收页面写
    String message=new String.toString(request.getParameter("message"),"gb2312"),String 有没有这个函数我不记得了,但好象就是这样做的,具体的形式问问别人吧!;
      

  2.   

    BASE64 编码是一种常用的字符编码,在很多地方都会用到。JDK 中提供了非常方便的 BASE64Encoder 和 BASE64Decoder,用它们可以非常方便的完成基于 BASE64 的编码和解码。// 将 s 进行 BASE64 编码
    public static String getBASE64(String s) {
      if (s == null) return null;
      return (new sun.misc.BASE64Encoder()).encode( s.getBytes() );
    }// 将 BASE64 编码的字符串 s 进行解码
    public static String getFromBASE64(String s) {
      if (s == null) return null;
      BASE64Decoder decoder = new BASE64Decoder();
      try {
        byte[] b = decoder.decodeBuffer(s);
        return new String(b);
      } catch (Exception e) {
        return null;
      }
    }
      

  3.   

    昏,我要分。
    这个答案我已经告诉你了。
    String message="删除成功";
    message=new String(message.getBytes(),"iso-8859-1");
    response.sendRedirect("success.jsp?message="+message+"&url=http://127.0.0.1");
    呵呵,要分