JS|JAVA|encodeURI|URLDecoder.decode

从页面跳转:

  encodeURI(encodeURI(url));

     获取值后<%=URLDecoder.decode(request.getParameter("custName"),"UTF-8")%>

从后台跳转:

    response.sendRedirect(url);需要对单个中文参数URLEncoder.encode(accountName,"utf-8")

    如:String url = "http://127.0.0.1:8080?a=1$accountName="+URLEncoder.encode(accountName,"utf-8");

    获取值后<%=URLDecoder.decode(request.getParameter("custName"),"UTF-8")%>

 

    

posted @ 2013-03-28 17:56  七郎  Views(2383)  Comments(0Edit  收藏  举报