updatestudent.jsp
来自「这是一个用Struts+Hibernate+Tomcat5.5.9实现的一个“课」· JSP 代码 · 共 169 行
JSP
169 行
<%@page contentType="text/html; charset=gb2312" language="java" errorPage="errorpage.jsp"%>
<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" --><!-- 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" -->
<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>
<%
int id=(new Integer(request.getParameter("id"))).intValue();
String username=request.getParameter("username");
String student_number=request.getParameter("student_number");
String name=new String((request.getParameter("name")).getBytes("ISO-8859-1"));
String password=request.getParameter("password");
//String sex=request.getParameter("sex");
int age=(new Integer(request.getParameter("age"))).intValue();
String telephone=request.getParameter("telephone");
String email=request.getParameter("email");
String address=new String((request.getParameter("address")).getBytes("ISO-8859-1"));
String department=new String((request.getParameter("department")).getBytes("ISO-8859-1"));
int mark=(new Integer(request.getParameter("mark")).intValue());
long teacher_id=(new Long(request.getParameter("teacher_id"))).longValue();
%>
<form method="post" action="updateStudent.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" id="select">
<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><%=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>
<tr>
<td align="right">所选教师:</td>
<td><input name="teacher_id" type="text" value="<%=teacher_id%>">
</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="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 + =
减小字号Ctrl + -
显示快捷键?