简单的一个学生管理系统 servlet+JSP
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'queryStudent.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> <script type="text/javascript" src="/soft08/js/queryStudent.js"></script> </head> <body> <h1> 学生信息查询 </h1> <form action="/soft08/StudentSer" method="post"> 学生姓名 <input type="text" name="sname" /> <input type="submit" value="祝你好运" /> <input type="hidden" name="status" value="queryStudent" /> </form> <c:if test="${requestScope.students!=null}"> <table border="1" width="500px"> <tr> <th>编号</th> <th> 姓名 </th> <th> 密码 </th> <th> 年龄 </th> <th> 性别 </th> <th> 所在班级 </th> <th> 更新 </th> <th> 删除 </th> </tr> <c:forEach items="${requestScope.students}" var="student" varStatus="num"> <tr> <td>${num.count}</td> <td>${student.sname}</td> <td><c:out value="${student.spass}" default=" " /></td> <td>${student.sage}</td> <td>${student.sex}</td> <td>${student.grade.gname}</td> <td> <c:url value="/admin/updateStudent.jsp" var="update"> <c:param name="sid" value="${student.sid}" /> <c:param name="sname" value="${student.sname}" /> <c:param name="sage" value="${student.sage}" /> <c:param name="sex" value="${student.sex}" /> <c:param name="spass" value="${student.spass}" /> <c:param name="gname" value="${student.grade.gname}" /> <c:param name="slikes" value="${student.slikes}" /> </c:url> <a href="${update}">更新</a> </td> <td>删除</td> </tr> </c:forEach> <tr> <td colspan="7"> <c:url value="/StudentSer" var="firstPage"> <c:param name="status" value="splitPage"/> <c:param name="currentPage" value="1" /> </c:url> <a href="${firstPage}">首页</a> <c:url value="/StudentSer" var="prePage"> <c:param name="status" value="splitPage"/> <c:param name="currentPage" value="${sessionScope.currentPage-1}" /> </c:url> <c:choose> <c:when test="${sessionScope.currentPage==1}"> 上一页 </c:when> <c:otherwise> <a href="${prePage}">上一页</a> </c:otherwise> </c:choose> <c:url value="/StudentSer" var="nextPage"> <c:param name="status" value="splitPage"/> <c:param name="currentPage" value="${sessionScope.currentPage+1}" /> </c:url> <c:choose> <c:when test="${sessionScope.currentPage==sessionScope.countPage}"> 下一页 </c:when> <c:otherwise> <a href="${nextPage}">下一页</a> </c:otherwise> </c:choose> <c:url value="/StudentSer" var="endPage"> <c:param name="status" value="splitPage"/> <c:param name="currentPage" value="${sessionScope.countPage}" /> </c:url> <a href="${endPage}">尾页</a> <form action="/soft08/StudentSer" method="post"> 跳转到指定页: <select name="currentPage" onchange="test()" id="currentPage"> <c:forEach begin="1" end="${sessionScope.countPage}" var="page"> <c:choose> <c:when test="${sessionScope.currentPage==page}"> <option value="${page}" selected="selected">${page}</option> </c:when> <c:otherwise> <option value="${page}">${page}</option> </c:otherwise> </c:choose> </c:forEach> </select> <input type="submit" value="go" /> <input type="hidden" name="status" value="splitPage" /> </form> ${sessionScope.currentPage}/${sessionScope.countPage} </td> </tr> </table> </c:if> </body> </html>
- 1
- 粉丝: 1
- 资源: 22
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
- 1
- 2
- 3
- 4
前往页