试试加一个:
 public String ex_chinese(String str){
     if(str==null){
     str  ="" ;
     }
     else{
         try {
        str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
         }
         catch (Exception ex) {
         }
     }
     return str ;
  }
============jsp调用=======================
例子:
String title=new String(mySmartUpload.getRequest().getParameter("title").getBytes("GBK"),"ISO8859-1");
   title = conn.ex_chinese(title);

解决方案 »

  1.   

    jsp首行:
    <%@ page contentType="text/html;charset=gb2312" %>bean保存在:
    你的jsp文件目录\WEB-INF\classes\没有就自己建目录
      

  2.   

    ublic String GBK(String action){try{byte[] b =action.getBytes("GB2312");String convert =new String(b,"8859_1");return convert;}catch(Exception e){}return null;}
    public static String AsciiToChineseString(String s)
    {
    char[] orig =s.toCharArray();byte[] dest =new byte[orig.length];for(int i=0;i<orig.length;i++)dest[i] =(byte)(orig[i]&0xFF);try{
    ByteToCharConverter toChar =ByteToCharConverter.getConverter("gb2312");
    return new String(toChar.convertAll(dest));}catch(Exception e){}return s;
    }
    public String replace(String con ,String tag,String rep){
    int j=0;
    int i=0;
    int k=0;
    String RETU="";
    String temp =con;
    int tagc =tag.length();
    while(i<con.length()){
    if(con.substring(i).startsWith(tag)){
    temp =con.substring(j,i)+rep;
    RETU+= temp;
    i+=tagc;
    j=i;
    }
    else{
    i+=1;
    }}
    RETU +=con.substring(j);
    return RETU;
    } }
      

  3.   

    String str=new String(msgstr.getBytes("ISO-8859-1"),"GBK")
      

  4.   

    new String(mystring.getBytes("iso8859_1"));//mystring 是你的要显示的变量名;
      

  5.   

    我的要好一点!
    //处理中文问题的自定义函数
    <%!
    public String getStr(String str)
    {
    try
    {
    String temp_p=str;
    byte[] temp_t=temp_p.getBytes("GBK");
    String temp=new String(temp_t,"ISO8859_1");
    return temp;
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    return "null";
    }
    %>
      

  6.   

    str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
    bean文件放在jsp同一下的目录\WEB-INF\classes\
      

  7.   

    <%@ page contentType="text/html;charset=GB2312"%>
    <%String str = new String(request.getParameter("str").getBytes("iso-8859-1"),"GB2312");%>