问号传递参数,jsp中怎么接收
<a href="${pageContext.request.contextPath}/1.jsp?id=1&name=abc> xxx </a> JSP <a> 传参
[解决办法]
楼主还是买本书去学吧。。。
<% String id = request.getParameter("id"); %>
[解决办法]
window.onload=function(){
var message = getUrlVars()["message"];
if(message!=null && typeof(message)!="undefined"){
alert(decodeURI(message));
}
}
function getUrlVars(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++){
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}