updateteacher.jsp

来自「这是一个用Struts+Hibernate+Tomcat5.5.9实现的一个“课」· JSP 代码 · 共 146 行

JSP
146
字号
<%@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">&nbsp;</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 tea_id=request.getParameter("username");
      session.setAttribute("userId",String.valueOf(tea_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>

<%
int id=(new Integer(request.getParameter("id"))).intValue();
String username=request.getParameter("username");
String name=new String((request.getParameter("name")).getBytes("ISO-8859-1"));
String age=request.getParameter("age");
String password=request.getParameter("password");
String sex=new String((request.getParameter("sex")).getBytes("ISO-8859-1"));
String email=request.getParameter("email");
String address=new String((request.getParameter("address")).getBytes("ISO-8859-1"));
String telephone=request.getParameter("telephone");
String title=new String((request.getParameter("title")).getBytes("ISO-8859-1"));
int classes_id=(new Integer(request.getParameter("classes_id"))).intValue();

%>
    <form name="form1" method="post" action="updateTeacher.do">
      <input type="hidden" name="id" value="<%=id%>">
      <table width="80%"  border="1" align="center">
        <tr>
          <td width="33%" align="right">教师姓名</td>
          <td width="67%"><input name="name" type="text" id="name" value="<%=name%>"></td>
        </tr>
        <tr>
          <td align="right">教师号</td>
          <td><input name="username" type="text" id="username" value="<%=username%>"></td>
        </tr>
        <tr>
          <td align="right">密码</td>
          <td><input name="password" type="password" id="password" value="<%=password%>"></td>
        </tr>
        <tr>
          <td align="right">职称</td>
          <td><select name="title" size="1">
              <option selected><%=title%></option>
              <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="sex" type="text" value="<%=sex%>"></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><input name="classes_id" type="text" value="<%=classes_id%>"></td>
        </tr>
      </table>
      <p align="center">
        <input type="submit" name="Submit" value="修改">
      </p>
    </form>
    <p>&nbsp;</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> | &copy;2005
    By Luo </div>
</div> 
<br> 
</body>
<!-- InstanceEnd --></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?