连接是http://127.0.0.1:8080/test.jsp?username=哈
执行以后得到的结果都是??
我尝试把这些编码方式改成GBK或者去掉他们都无济于事,到底是怎么回事的,给位请指教,谢谢!

解决方案 »

  1.   

    String s="www"; 
    try{ 
    String s=new String(s.getBytes("ISO-8859-1"),"GBK"); 

    catch(Exception e) 
    {}
      

  2.   

    String w="www"; 
    try{ 
    String s=new String(w.getBytes("ISO-8859-1"),"GBK"); 

    catch(Exception e) 
    {}
      

  3.   

    <@ page contentType="text/html;charset=gb2312">
    <@ page import="java.net.*" >
    <
    String temp=java.net.URLEncoder.encode("哈");
    >
    <p><a href="test1.jsp?username=<=temp>">表1</a></p>这样就没有乱码了
    ================================================================
    充电中...
      

  4.   

    out.println(new String(request.getParameter("username")));
    ================================================================
    充电中...
      

  5.   

    把这一句<%@ page contentType="text/html;charset=gb2312"%>去掉。
      

  6.   

    <%@ page contentType="text/html;charset=gb2312"%>//的加上
    String stringValue2=new String(stringValue1.getBytes("8859_1"), "GB2312");