011_学生管理系统二
生活随笔
收集整理的這篇文章主要介紹了
011_学生管理系统二
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
19. index.html
<!DOCTYPE html> <html><head><meta charset="UTF-8" /><title>主頁(yè)面</title></head><body><h1><a href="StudentListServlet.action">查找所有學(xué)生</a></h1><h1><a href="StudentListPageServlet.action?currentPage=1">分頁(yè)查找所有學(xué)生</a></h1></body> </html>20. 所有學(xué)生列表頁(yè)面list.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!DOCTYPE html> <html><head><meta charset="UTF-8" /><title>學(xué)生列表頁(yè)面</title><script type="text/javascript">function doDelete(sid) {var flag = confirm("是否確定刪除?");if(flag){location.href="DeleteServlet.action?sid="+sid;}}</script></head><body><form action="SearchStudentServlet.action" method="post"><table border="1px" width="1300px" align="center"><tr><td colspan="8">按姓名查詢:<input type="text" name="sname"/> 按性別查詢:<select name="gender"><option value="">--請(qǐng)選擇--<option value="男">男<option value="女">女</select> <input type="submit" value="查詢"> <a href="add.jsp">添加</a></td></tr><tr><td width="100px">編號(hào)</td><td width="100px">姓名</td><td width="50px">性別</td><td width="150px">電話</td><td width="200px">愛(ài)好</td><td width="400px">詳情</td><td width="200px">出生年月日</td><td width="100px">操作</td></tr><c:forEach items="${studentList}" var="student"><tr><td>${student.sid}</td><td>${student.sname}</td><td>${student.gender}</td><td>${student.phone}</td><td>${student.hobby}</td><td>${student.info}</td><td>${student.birthday}</td><td><a href="EditServlet.action?sid=${student.sid}">修改</a> <a href="#" onclick="doDelete(${student.sid})">刪除</a></td></tr></c:forEach></table></form></body> </html>21. 分頁(yè)學(xué)生列表頁(yè)面page_list.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!DOCTYPE html> <html><head><meta charset="UTF-8" /><title>學(xué)生列表頁(yè)面</title><script type="text/javascript">function doDelete(sid) {var flag = confirm("是否確定刪除?");if(flag){location.href="DeleteServlet.action?sid="+sid;}}</script></head><body><form action="SearchStudentServlet.action" method="post"><table border="1px" width="1300px" align="center"><tr><td colspan="8">按姓名查詢:<input type="text" name="sname"/> 按性別查詢:<select name="gender"><option value="">--請(qǐng)選擇--<option value="男">男<option value="女">女</select> <input type="submit" value="查詢"> <a href="add.jsp">添加</a></td></tr><tr><td width="100px">編號(hào)</td><td width="100px">姓名</td><td width="50px">性別</td><td width="150px">電話</td><td width="200px">愛(ài)好</td><td width="400px">詳情</td><td width="200px">出生年月日</td><td width="100px">操作</td></tr><c:forEach items="${pageBean.list}" var="student"><tr><td>${student.sid}</td><td>${student.sname}</td><td>${student.gender}</td><td>${student.phone}</td><td>${student.hobby}</td><td>${student.info}</td><td>${student.birthday}</td><td><a href="EditServlet.action?sid=${student.sid}">修改</a> <a href="#" onclick="doDelete(${student.sid})">刪除</a></td></tr></c:forEach><tr><td colspan="8">第 ${pageBean.currentPage} / ${pageBean.totalPage} 每頁(yè)顯示:<strong>${pageBean.pageSize}條 </strong> 總的記錄數(shù):<strong>${pageBean.totalSize}</strong> <c:if test="${pageBean.currentPage !=1 }"><a href="StudentListPageServlet.action?currentPage=1">[首頁(yè)]</a>| <a href="StudentListPageServlet.action?currentPage=${pageBean.currentPage-1 }">[上一頁(yè)]</a></c:if><c:forEach begin="1" end="${pageBean.totalPage }" var="i"><c:if test="${pageBean.currentPage == i }">${i }</c:if><c:if test="${pageBean.currentPage != i }"><a href="StudentListPageServlet.action?currentPage=${i }">[${i}]</a></c:if></c:forEach><c:if test="${pageBean.currentPage !=pageBean.totalPage }"><a href="StudentListPageServlet.action?currentPage=${pageBean.currentPage+1 }">[下一頁(yè)]</a> | <a href="StudentListPageServlet.action?currentPage=${pageBean.totalPage }">[尾頁(yè)]</a></c:if></td></tr></table></form></body> </html>22. 添加學(xué)生頁(yè)面add.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><!DOCTYPE html> <html><head><meta charset="UTF-8" /><title>添加學(xué)生信息</title></head><body><form action="AddServlet.action" method="post"><table border="1px" width="400px"><tr><td>姓名:<input type="text" name="sname"></td></tr><tr><td>性別:<input type="radio" name="gender" value="男">男<input type="radio" name="gender" value="女">女</td></tr><tr><td>電話:<input type="text" name="phone"></td></tr><tr><td>愛(ài)好:<input type="checkbox" name="hobby" value="旅游">旅游<input type="checkbox" name="hobby" value="美食">美食<input type="checkbox" name="hobby" value="游泳">游泳<input type="checkbox" name="hobby" value="唱歌">唱歌</td></tr><tr><td>詳情:<textarea rows="3" cols="20" name="info"></textarea></td></tr><tr><td>出生年月日:<input type="text" name="birthday"></td></tr><tr><td><input type="submit"></td></tr></table></form></body> </html>23. 編輯學(xué)生頁(yè)面edit.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %><!DOCTYPE html> <html><head><meta charset="UTF-8" /><title>更新學(xué)生頁(yè)面</title></head><body><form action="UpdateServlet.action" method="post"><input type="hidden" name="sid" value="${student.sid}"><table border="1" width="600px"><tr><td>姓名</td><td><input type="text" name="sname" value="${student.sname}"></td></tr><tr><td>性別</td><td><input type="radio" name="gender" value="男" <c:if test="${student.gender == '男'}">checked</c:if>>男<input type="radio" name="gender" value="女" <c:if test="${student.gender == '女'}">checked</c:if>>女</td></tr><tr><td>電話</td><td><input type="text" name="phone" value="${student.phone}"></td></tr><tr><td>生日</td><td><input type="text" name="birthday" value="${student.birthday}"></td></tr><tr><td>愛(ài)好</td><td><input type="checkbox" name="hobby" value="旅游" <c:if test="${fn:contains(student.hobby,'旅游') }">checked</c:if>>旅游<input type="checkbox" name="hobby" value="美食" <c:if test="${fn:contains(student.hobby,'美食') }">checked</c:if>>美食<input type="checkbox" name="hobby" value="游泳" <c:if test="${fn:contains(student.hobby,'游泳') }">checked</c:if>>游泳<input type="checkbox" name="hobby" value="唱歌" <c:if test="${fn:contains(student.hobby,'唱歌') }">checked</c:if>>唱歌</td></tr><tr><td>簡(jiǎn)介</td><td><textarea name="info" rows="3" cols="20">${student.info }</textarea></td></tr><tr><td colspan="2"> <input type="submit" value="更新"> </td></tr></table></form></body> </html>24. 學(xué)生表信息
25. 運(yùn)行查看index.html
26. 點(diǎn)擊查找所有學(xué)生
27. 選擇"男", 點(diǎn)擊查詢
28. 輸入框輸入"王", 點(diǎn)擊查詢
29. 點(diǎn)擊添加, 跳轉(zhuǎn)到添加界面
30. 填寫(xiě)學(xué)生信息, 點(diǎn)擊提交按鈕
31. 修改學(xué)生信息
32. 刪除學(xué)生
33. 點(diǎn)擊分頁(yè)查找所有學(xué)生
總結(jié)
以上是生活随笔為你收集整理的011_学生管理系统二的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 010_学生管理系统一
- 下一篇: 012_自动登录