分页,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 序号 12 员工号 13 员工姓名<br/> 14 <c:forEach varStatus="s" items="${requestScope.empList}" var="emp"> 15 ${s.index + 1} 16 ${emp.empNo } 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>