📄 getstudent.jsp
字号:
<%@page contentType="text/html; charset=gb2312" language="java" errorPage="errorpage.jsp"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="hibernate.HibernateUtil"%>
<%@ page import="hibernate.Student"%>
<%@ page import="hibernate.Teacher"%>
<html><!-- InstanceBegin template="/Templates/admin.dwt.jsp" codeOutsideHTMLIsLocked="false" -->
<!-- DW6 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!-- InstanceBeginEditable name="doctitle" -->
<title>学生</title>
<!-- InstanceEndEditable --><link rel="stylesheet" href="2col_leftNav.css" type="text/css">
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.style2 {font-size: 14px}
-->
</style>
<!-- InstanceEndEditable -->
</head>
<!-- The structure of this file is exactly the same as 2col_rightNav.html;
the only difference between the two is the stylesheet they use -->
<body>
<%
String admin_id = (String)session.getAttribute("username");
if(admin_id==null){
response.sendRedirect("index.jsp");
}
%>
<div id="masthead">
<h1 id="siteName"> </h1>
<div id="globalNav">
<a href="#">global link</a> | <a href="#">global link</a> | <a href="#">global
link</a> | <a href="#">global link</a> | <a href="#">global link</a> | <a href="#">global
link</a> | <a href="#">global link</a>
</div>
</div>
<!-- end masthead -->
<div id="content">
<div class="feature"><!-- InstanceBeginEditable name="EditRegion1" -->
<%
int id;
String username;
String student_number;
String name;
String password;
String sex;
int age;
String telephone;
String email;
String address;
String department;
int mark;
Teacher teacher;
long teacher_id;
%>
<h3>Feature Title </h3>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec molestie.
Sed aliquam sem ut arcu. Phasellus sollicitudin. Vestibulum condimentum facilisis
nulla. In hac habitasse platea dictumst. Nulla nonummy. Cras quis libero.
Cras venenatis. Aliquam posuere lobortis pede. Nullam fringilla urna id leo.
Praesent aliquet pretium erat. Praesent non odio. Pellentesque a magna a
mauris vulputate lacinia. Aenean viverra. Class aptent taciti sociosqu ad
litora torquent per conubia nostra, per inceptos hymenaeos. Aliquam lacus.
Mauris magna eros, semper a, tempor et, rutrum et, tortor.
</p>
<p class="style2"><a href="addStudent.jsp">新加学生</a></p>
<table width="95%" border="1">
<tr>
<td><span class="style2">ID</span></td>
<td><span class="style2">用户名</span></td>
<td><span class="style2">学生号</span></td>
<td><span class="style2">姓名</span></td>
<td><span class="style2">密码</span></td>
<td><span class="style2">性别</span></td>
<td><span class="style2">电话</span></td>
<td><span class="style2">年龄</span></td>
<td><span class="style2">E_mail</span></td>
<td><span class="style2">地址</span></td>
<td><span class="style2">系别</span></td>
<td><span class="style2">学分</span></td>
<td><span class="style2">教师ID</span></td>
<td><span class="style2">删除</span></td>
<td><span class="style2">更新</span></td>
</tr>
<%
List result=HibernateUtil.getStudent();
Iterator it = result.iterator();
while(it.hasNext()){
Student student=(Student)it.next();
id=(student.getId()).intValue();
username=student.getUsername();
student_number=student.getStudent_number();
name=student.getName();
password=student.getPassword();
sex=student.getSex();
age=(student.getAge()).intValue();
telephone=student.getTelephone();
email=student.getEmail();
address=student.getAddress();
department=student.getDepartment();
mark = (student.getMark()).intValue();
teacher=student.getTeacher();
teacher_id=(teacher.getId()).longValue();
%>
<tr>
<td><span class="style2"><%=id%><span class="style2"></td>
<td><span class="style2"><%=username%><span class="style2"></td>
<td><span class="style2"><%=student_number%><span class="style2"></td>
<td><span class="style2"><%=name%><span class="style2"></td>
<td><span class="style2"><%=password%><span class="style2"></td>
<td><span class="style2"><%=sex%><span class="style2"></td>
<td><span class="style2"><%=telephone%><span class="style2"></td>
<td><span class="style2"><%=age%><span class="style2"></td>
<td><span class="style2"><%=email%><span class="style2"></td>
<td><span class="style2"><%=address%><span class="style2"></td>
<td><span class="style2"><%=department%><span class="style2"></td>
<td><span class="style2"><%=mark%><span class="style2"></td>
<td><span class="style2"><%=teacher_id%><span class="style2"></td>
<td><a href="delectStudent.do?id=<%=id%>" class="style2">删除</a></td>
<td><a href="updateStudent.jsp?id=<%=id%>&username=<%=username%>&student_number=<%=student_number%>&name=<%=name%>&password=<%=password%>&sex=<%=sex%>&age=<%=age%>&telephone=<%=telephone%>&email=<%=email%>&address=<%=address%>&department=<%=department%>&mark=<%=mark%>&teacher_id=<%=teacher_id%>" class="style2">更新</a> </td>
</tr>
<%}%>
</table>
<p> </p>
<!-- InstanceEndEditable -->
</div>
</div>
<!--end content -->
<div id="navBar">
<div id="search">
<form action="#">
<label>search</label>
<input name="searchFor" type="text" size="10">
<input name="goButton" type="submit" value="go">
</form>
</div>
<div id="sectionLinks">
<ul>
<li><a href="getStudent.jsp">学生</a></li>
<li><a href="getTeacher.jsp">教师</a></li>
<li><a href="getCourse.jsp">课程</a></li>
<li><a href="getClass.jsp">班级</a></li>
<li><a href="logoff.do">退出</a></li>
</ul>
</div>
<div id="headlines"></div>
</div>
<!--end navbar -->
<div id="siteInfo">
<div align="center"><a href="#">About Us</a> | <a href="#">Site
Map</a> | <a href="#">Privacy Policy</a> | <a href="#">Contact Us</a> | ©2005
By Luo </div>
</div>
<br>
</body>
<!-- InstanceEnd --></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -