两个页面头都有
<%@ page contentType = "text/html;charset=gb2312"%>的话, 
再用
<%
//处理中文
String message = request.getParameter("error");
if(message == null){
    message = "";
}
try{
        byte temp_b[] = message.getBytes("ISO-8859-1");  
        message = new String(temp_b,"gb2312");
}
catch(Exception e){
}
%>
应该没问题的,我一直这么用啊

解决方案 »

  1.   

    对啊,我也觉得没问题啊
    1、在网页中输出中文。
    JAVA在网络传输中使用的编码是"ISO-8859-1",故在输出时需要进行转化,如:
    String str="中文";
    str=new String(str.getBytes("GB2312"),"8859_1");
    但如果在编译程序时,使用的编码是“GB2312”,且在中文平台上运行此程序,不会出现此问题,一定要注意。
    2、从参数中读取中文
    这正好与在网页中输出相反如:
    str=new String(str.getBytes("8859_1"),"GB2312");
      

  2.   

    实际上,我的两个页面确实都有<%@ page contentType = "text/html;charset=gb2312"%>
    这样的语句唉~郁闷啊
      

  3.   

    如果这要的话,你可以不转化试下。
    真接= request.getParameter("error");
    不要进行中文处理
      

  4.   

    呵呵,可能你的系统是微软特制的吧,为了抽奖????maybe
      

  5.   

    你把处理字符串的功能写到一个bean里去,然后单独调试一下看有没有问题,没问题放到jsp里也没问题
    如果还是不行,可能真是系统问题了
      

  6.   

    String temp_username = new String(request.getParameter("name").getBytes("ISO8859-1"));