几种JSP页面传值方式:


几种JSP页面传值方式:
1. 隐藏域传值:
<form method="post" action="client_crud.jsp" >
<input type="hidden" name="id" value="<%=id %>">

2. URL传值:
用button
a.
<input name="btnModify" type="button" class="button1" onClick="self.location='client_modify.jsp?id=<%=id %>'"
value="修改分销商" />
b.把input的onClick=”modifyRegion()”
function modifyRegion() {
window.self.location = client_node_modify.jsp?id=<%=id%>";
}


3. JS方式传值
//取得form对象提交表单
with(document.getElementById("userForm")) {
method="post";
action="user_add.jsp?command=add";
submit();
}
function searchItem() {
with(document.forms[0]) {
action="servlet/basedata/SearchItemServlet";
method="post";
submit();
}
}


你可能感兴趣的:(jsp,servlet)