URL传递中文参数,默认格式为ISO-8859-1,一般在接收该参数时,如果不进行编码,得到的会是乱码。
   如果在url中直接使用中文,如:
http://website/login.jsp?name=好&pwd=000
在接收参数name时,只需要进行一下编码方式的转换就OK了,如:
<%@ page language= "java" pageEncoding= "GB2312"%>    
    <%    
         String name= request.getParameter( "name");    
         String result =  new String(name.getBytes( "ISO-8859-1"),  "GB2312");             
    %>    
 
这样获取到的参数就正常了。
   更常用的方法为:对url中的中文参数进行编码,变成为name=%20D...这样的字符。
   在设置参数的页面中使用:
<a href= "login.jsp?name=<%=URLEncoder.encode("")%>&pwd=000">中文参数</a>
再获取参数页面使用:
<%    
        String name= URLDecoder.decode(request.getParameter( "name"));         
        String result =  new String(name.getBytes( "ISO-8859-1"), "GB2312");         
%>