JS中用encodeURIComponent編碼,后台JAVA解碼


JS中用encodeURIComponent編碼兩次

var p = {};
p.Map = [{f : 'customNo', t : '客戶編號'},{f : 'customName', t : '客戶名稱'}];
var param = JSON.stringify(p);
var url = "http://localhost:8080?data=" + encodeURIComponent(encodeURIComponent(param))
window.open(ulr);

JAVA中解碼

String data = request.getParameter("data");
data = java.net.URLDecoder.decode(data, "UTF-8");


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM