码迷,mamicode.com
首页 > Web开发 > 详细

jsp页面传值获取问题的方法

时间:2015-04-17 17:27:19      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:

jsp1页面url如下

function gotourl(type){
    window.location.href="${ctxPath}/jsp/order/order_add.jsp?tel="+tel;
} 

jsp2页面而需要得到tel这个参数。并且放入隐藏域<input type="hidden" name="roomType" id="tel" value="">中

方法一:

1 <script type="text/javascript">  
2     <%  
3         String type = (String)request.getParameter("roomType");  
4     %>   
5     document.getElementById("roomType").value=<%=type%>;  
6 </script>  

方法二:

1 <input type="hidden" name="tel" id="tel" value="${param.tel }"/>  

 

jsp页面传值获取问题的方法

标签:

原文地址:http://www.cnblogs.com/GetAlert/p/4435206.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!