分页,submit

 

 

 

 1 <script type="text/javascript">
 2     var goPage = function(p){
 3     document.getElementById("p").value = p;
 4     document.getElementById("fm").submit();
 5 }
 6 </script>
 7 </head>
 8 <body>
 9       
10  <center>
11      序号&nbsp;&nbsp;&nbsp;&nbsp;
12      员工号&nbsp;&nbsp;&nbsp;&nbsp;
13      员工姓名<br/>
14 <c:forEach varStatus="s" items="${requestScope.empList}" var="emp">
15 ${s.index + 1}&nbsp;&nbsp;&nbsp;&nbsp;
16 ${emp.empNo }&nbsp;&nbsp;&nbsp;&nbsp;
17 ${emp.ename }<br/>
18 </c:forEach>
19           
20 <c:forEach var="i" begin="1" end="${totalPage}">
21 <a href="javascript:void(0);" onclick="goPage(${i });">${i }</a>
22 </c:forEach>
23 <c:set value="${pageContext.request.contextPath }" var="ctx"></c:set><%-- 封装绝对路径 --%>
24 <form id="fm" method="post" action="${ctx }/server.jsp">
25 <input type="hidden" name="p" id="p" />
26 </form>
27 </center>
28 </body>

 

posted @ 2015-01-17 16:31  江湖一笑  阅读(230)  评论(0编辑  收藏  举报