可能是缓存问题
文件头上加上:
response.setHeader("Pragma","No-cache"); 
response.setHeader("Cache-Control","no-cache"); 
response.setDateHeader("Expires", 0);

解决方案 »

  1.   

    jsp页面要这个好一点:<%@ page contentType="text/html;charset=gb2312" %>
      

  2.   

    <%@ page contentType="text/html;charset=gb2312" %>
    这句好像不是万能的。
    =============================我的服务器是Jrun3.1。当从数据库(oracle)提取数据时,用它能正常显示。但是用表单从一个jsp传到另一个jsp时,这句就得改成:
    <%@ page contentType="text/html;charset=ISO8859_1" %>
    才能正常显示。目前我遇到的问题是:既有从jsp传过来的,又有从oracle提取出来的数据,并且都是中文字符串,用上面哪中都不合适。不知道怎么办?
      

  3.   

    在页面里加上
    <%@ page contentType="text/html;charset=gb2312" %>
    保证oracle里数据能正常显示
    再把从form里取来的数据做如下转换
    String varName=new String(request.getParameter("varName").getBytes("ISO8859-1"));
    out.println(varName);
      

  4.   

    这是编码问题,因为jsp里面用的编码是unicode,所以,freefalcon得做法,就是把你从form里面来的数据转换掉.
      

  5.   

    可是是这样的,我在自己的机器上(WIN2000)下就是用类似于心宇的办法是可以解决的,而且很稳定,服务器是TOMCAT4.0。可是公司服务器是SOLARIS系统,用的是TOMCAT3.X,(X是几不太清楚)然后就处现目前的问题,特不稳定,一会好一会坏的。如果用out.println();来输出传过来的参数,一看是显示的中文,挺好的;可是你一刷新就会变成问号,简直气死了。这个问题一直困扰着我,有谁能告诉我一条明路呀?多谢了!!
      

  6.   

    //==================================================================================
    //個人經驗.歡迎交流
    //==================================================================================
    1.進行字符的轉換.要寫函數.一般第一個函數TranStrType就可以了.但有時用其他函數多試幾次
    <%!
    public String TranStrType(String str) throws Exception
    {
    byte[] _tempByte=str.getBytes("ISO8859-1");
    String _tempStr=new String(_tempByte);
    return _tempStr;
    }public static String ISOtoGBK(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("ISO8859-1"),"GBK"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 


    public static String ISOtoGB2312(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("ISO8859-1"),"gb2312"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 

    }
    public static String ISOtoBIG5(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("ISO8859-1"),"big5"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 


    public static String Gb2312toISO(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("gb2312"), "ISO8859-1"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 


    public static String GBKtoISO(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("gbk"), "ISO8859-1"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 

    }
    public static String GIG5toISO(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("big5"), "ISO8859-1"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 

    }
    %>
    2.用Tomcat4.0.
    這個版本的Tomcat再直接連接中文名的文件不會出現找不到文件的情況.而4.1則不行4.在JSP文件第一行加
    <%@ page contentType="text/html;charset=big5"%>(繁體 )
    <%@ page contentType="text/html;charset=gb2312"%>(簡體 )5.在html的head中加入
    <meta http-equiv="Content-Type" content="text/html; charset=big5">(繁體 )
    <meta http-equiv="Content-Type" content="text/html; charset=gb2313">簡體 )6.如果是在IE中直接顯示Excel,Word,PowerPoint.則在jakarta-tomcat-4.0\conf的web.xml文件中加入
        <mime-mapping>
            <extension>xls</extension>
            <mime-type>application/msxls</mime-type>
        </mime-mapping>
        <mime-mapping>
            <extension>doc</extension>
            <mime-type>application/msword</mime-type>
        </mime-mapping>
        <mime-mapping>
            <extension>ppt</extension>
            <mime-type>application/vnd.ms-powerpoint</mime-type>
        </mime-mapping>//=======================================================================================
      

  7.   

    可能是缓存问题
    文件头上加上:
    response.setHeader("Pragma","No-cache"); 
    response.setHeader("Cache-Control","no-cache"); 
    response.setDateHeader("Expires", 0);
      

  8.   

    我也踫到过这样的问题,当时我用的是tomcat3,用ie6浏览时,在第一次提交没有问题,后来提交的就会出现乱码,后来我换成了tomcat4就没有这样的问题了
      

  9.   

    IE -> 查看 -> 编码 -> 简体中文,  不要自动选择
      

  10.   

    问狗熊MM,我用TOMCAT4确实也比较稳定,可是服务器上是3.x没办法。你当时没想一下这是什么原因吗?在3.x下就解决不了吗?还有逍遥小贼兄,你的办法没法子实施啊!我们怎么控制上网的人的IE啊!