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