我想,你在JSP中也应该对字符进行转换一次吧
public static String toGB2312(String str) {
    if (str == null) {
      return null;
    }
    try {
      return new String(str.getBytes("ISO8859_1"), "gb2312");
    }
    catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    }
    return null;
  }

解决方案 »

  1.   

    在jsp 里加入下面的语句就可以了
    <%@page contentType="text/html;charSet=gb2312"%>
    <%request.setCharacterEncoding("GB2312");%>
      

  2.   

    将所有的.jsp页面用utf-8字符集
    做一个字符集filter(可以直接用tomcat的那个)
    改你的应用中web.xml文件,将字符filter的值设为utf-8做上述工作后,绝大部分乱码问题都可克服,不知对你的这种情况是否有帮助。
      

  3.   

    对字符进行重新编码看看。具体的代码如下:
    <%@ page contentType="text/html; charset=gb2312"%> 
    <%@ page import="java.io.*"%>
    <%! String trans(String chi)
    {
                   String result = null;
                   byte temp [];
                   try
                   {
                           temp=chi.getBytes("iso-8859-1");
                          result = new String(temp);
                    }
                    catch(UnsupportedEncodingException e)
                    {
                            System.out.println (e.toString());
                    }
    return result;
    }
    %>
    <%
    out.println(trans(request.getParameter("name")));
    %>
      

  4.   

    要先加这个<%@ page contentType="text/html; charset=gb2312"%>
    然后后面要把ISO8859-1转为GB2312