📄 edit_infor.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/student.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" --><!-- 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 username = (String) session.getAttribute("username");
if(username==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" -->
<%
String student_number="",name="",password="",telephone="",email="",address="",department="";
int id=0,age=0,mark=0;
List result=HibernateUtil.findStudent(username);
Iterator it=result.iterator();
if(it.hasNext()){
Student student=(Student)it.next();
id=(student.getId()).intValue();
age=(student.getAge()).intValue();
mark=(student.getMark()).intValue();
student_number=student.getStudent_number();
name=student.getName();
password=student.getPassword();
telephone=student.getTelephone();
email=student.getEmail();
address=student.getAddress();
department=student.getDepartment();
}
%>
<form method="post" action="edit_infor.do">
<input type="hidden" name="id" value="<%=id%>">
<table width="80%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="48%" align="right">用户名:</td>
<td width="52%"><input name="username" type="text" value="<%=username%>">
</td>
</tr>
<tr>
<td width="48%" align="right">学生号:</td>
<td width="52%"><input name="student_number" type="text" value="<%=student_number%>">
</td>
</tr>
<tr>
<td align="right">姓名:</td>
<td><input name="name" type="text" id="name" value="<%=name%>">
</td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input name="password" type="password" value="<%=password%>">
</td>
</tr>
<tr>
<td align="right">性别:</td>
<td><select name="sex" size="1">
<option>男</option>
<option>女</option>
</select>
</td>
</tr>
<tr>
<td align="right">年龄:</td>
<td><input name="age" type="text" value="<%=age%>">
</td>
</tr>
<tr>
<td align="right">电话:</td>
<td><input name="telephone" type="text" value="<%=telephone%>">
</td>
</tr>
<tr>
<td align="right">E-MAIL:</td>
<td><input name="email" type="text" value="<%=email%>">
</td>
</tr>
<tr>
<td align="right">地址:</td>
<td><input name="address" type="text" value="<%=address%>">
</td>
</tr>
<tr>
<td align="right">所在系</td>
<td><select name="department" size="1">
<option selected><%=department%></option>
<option>计算机</option>
<option>机械系</option>
<option>电子系</option>
<option>数理系</option>
</select>
</td>
</tr>
<tr>
<td align="right">学分:</td>
<td><input name="mark" type="text" value="<%=mark%>">
</td>
</tr>
</table>
<p align="center">
<input type="submit" name="Submit" value="修改">
</p>
</form>
<p> </p>
<!-- InstanceEndEditable -->
</div>
</div>
<!--end content -->
<div id="navBar">
<div id="search">
<form action="#">
<label>search</label>
<input name="searchFor" type="text" size="15">
<input name="goButton" type="submit" value="go">
</form>
</div>
<div id="sectionLinks">
<ul>
<li><a href="select_course.jsp">选修课程</a></li>
<li><a href="mygrade.jsp">查看成绩</a></li>
<li><a href="edit_infor.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 + -