地址中传值,必须要将它的编码转化
发送时:name=URLEncoder.encode(name);
接收时:name=new String(name.getBytes("ISO8859-1"),"GB2312");

解决方案 »

  1.   

    如果是javascript传给jsp呢
    如:
    var  name="人民";
     window.open("sales.jsp?name="+name,"","");
    在jsp中怎么做
      

  2.   

    显示时文件头上加:
    <%@ page contentType="text/html;charset=gb2312" %>
    request.getParameter("name");
      

  3.   

    可以用window.open("sales.jsp?name=<%=name%>","","");
      

  4.   

    <%@ page contentType="text/html;charset=gb2312" %>
    改成:
    <%@ page contentType="text/html;charset=ISO8859_1" %>
      

  5.   

    //试试下面的每个方法,转换得到的参数!
    public static String iso8859togbk(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 iso8859togb2312(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 gb2312to8859(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 gbkto8859(String strvalue) 

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

    strvalue = new String(strvalue.getBytes("gbk"), "ISO8859_1"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 

      

  6.   

    在sales.jsp得到这个name值的时候做一个转换;
    name=codeformat(name);
    codeformat函数如下:
      public String codeformat(String ss) {
      //处理中文问题
      try{
       String temp_p=ss;
       byte[] temp_t=temp_p.getBytes("ISO8859-1");
       ss=new String(temp_t);
     }catch(Exception e){
       System.err.println("toChinese exception:"+e.getMessage());
     }
    return ss;
      }