要用过滤器(filter)过虑一下。

解决方案 »

  1.   

    如何使用过滤器(filter)过虑
      

  2.   

    中文做参数传递时,会转换成ISO8859-1.所以要用getBytes(GB2312)进行转换一下。
    送你一段JavaBean吧
    /**
     * Title:        含有中文的字符串转换成能正常显示中文的字符串
     *
     * Description:  --beans scope 推荐: "page"或"application"
     *
     **/public class tranChinese
      {
        public String toChinese(String s)
          {
            if (s != null)
             {
               try
                {
                   return new String(s.getBytes("iso-8859-1"), "GB2312");
                }
              catch (java.io.UnsupportedEncodingException e)
    {
      System.out.println(e.toString());
    }
             }
            return s;
          }public String toUnicode(String s)
      {
        if (s != null)
         {
           try
            {
              return new String(s.getBytes("GB2312"), "iso-8859-1");
            }
           catch (java.io.UnsupportedEncodingException e)
    {
       System.out.println(e.toString());
    }
         }
        return s;
      }
    }
      

  3.   

    处理提交信息的页面头加入下面语句:request.setCharacterEncoding("GBK");