2.URL传值:用buttona.'"value="修改分销商"/>b.把input的onClick=”modifyRegion()”functionmodifyRegion(){window.self.location=client_node_modify.jsp?id=";}3.JS" />
文档库 最新最全的文档下载
当前位置:文档库 › 几种JSP页面传值方式

几种JSP页面传值方式

2010-01-25
几种JSP页面传值方式:
文章分类:Web前端

几种JSP页面传值方式:
1. 隐藏域传值:




2. URL传值:
用button
a.
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的几种参数传值:
2009-10-15 09:21

JSP的几种参数传值:

一、超链接
链接

二、forma表单
1.可显示的控件


2.如果要传递的值,不需要显示在页面上
(1)
(2)


三、JSP的include和forward标签




四、javascript方式
script type="text/javascript">
function demo(){
var v = document.all('username').value;
location.replace("V.jsp?username="+v+"&age=25");
}





onclick="location.replac('V.jsp?pwd=123456789')">





注:数据提交方式分为get和post两种

1、get和post的区别
A.GET请求只能处理小数据<2K
POST可以用来提交大数据
B.post提交方式相对而言,比较安全
get只是适合于小数据的传递,也就是说,只有post才能传递大数据,比如在文件上传时,就必须将method
指定为post

2、用post提交的情况:
当你的form表单的method属性指定为post,其提交方式才为post
其他的所有情况统统为get请求


----------------------------------------------------------------------------------------------------------------------------------------------------------

相关文档
相关文档 最新文档