传参处:encodeURI()
/***
* 获取URL后的值* */
function GetRequest() {
var url = location.search; //获取url中"?"符后的字串
url = decodeURI(url);
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for(var i = 0; i < strs.length; i ++) {
theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
}
}
return theRequest;
}
var Request = new Object();
Request = GetRequest();
var bm = Request["bm"];
jsp to jsp
方式二,源
function yulan(){
var ypbt = $("#xxbt").val();
var ypnr = CKEDITOR.instances.qbnr.getData();
var bjr = $("#sbrname").text();
var url = "/gacs/mb/ypmb.htm?ypbt="+escape(encodeURIComponent(ypbt))+"&ypnr="+escape(encodeURIComponent(ypnr))+"&bjr="+escape(encodeURIComponent(bjr));
window.open (url);
}
目标:
String ypbt = java.net.URLDecoder.decode(StringUtils.clearNull(request.getParameter("ypbt")),"UTF-8");