1:在jsp页面加入:<%@ page contentType="text/html; charset=gb2312" %>2:上面的如果在不行就用如下的方法在数据入库前进行调用:public static String UnicodeToChinese(String s){  try{     if(s==null||s.equals("")) return "";     String newstring=null;     newstring=new String(s.getBytes("ISO8859_1"),"gb2312");     return newstring;    }  catch(UnsupportedEncodingException e)  {  return s;  }  } public static String ChineseToUnicode(String s){  try{  if(s==null||s.equals("")) return "";  String newstring=null;  newstring=new String(s.getBytes("gb2312"),"ISO8859_1");   return newstring;  }  catch(UnsupportedEncodingException e)  {  return s; }  } 

解决方案 »

  1.   

    http://expert.csdn.net/Expert/topic/1085/1085595.xml?temp=.3803675
      

  2.   

    <% request.setCharacterEncoding("gb2312"); %> 
    这条代码可以。
      

  3.   

    <%@ page contentType="text/html; charset=gb2312" %>
    <%
       out.print("中文").toString();
    %>
      

  4.   

    <%@ page contentType="text/html; charset=gb2312" %>这样在本页面应该是没问题的呀,如果是数据库或者是SESSION传递和FORM传递用
    user=request.getParameter("user");
    byte[] tmpbyte=user.getBytes("ISO8859_1");
    user=new String(tmpbyte);
    只要对USER作一个编码转换试试,可以的话写成BEAN就行了
      

  5.   

    直接用<%@ page contentType="text/html;charset=gb2312"%>就可以了
      

  6.   

    sorry,写错了
    应该是:
    <%@ page contentType="text/html; charset=gb2312" %>
    <%@ page import="java.io.*" %>
    <%
       out.println(("中文").toString());
    %>
      

  7.   

    <%@ page contentType="text/html; charset=gb2312" %>
    <%@ page import="java.io.*" %>
    如果还是不行就在静态页面中加:
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    应该可以了。