⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addstudent.jsp

📁 这是一个用Struts+Hibernate+Tomcat5.5.9实现的一个“课程管理系统”
💻 JSP
字号:
<%@page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="errorpage.jsp"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="hibernate.HibernateUtil"%>
<%@ 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" --><!-- 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" -->
   <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>
    <form name="form1" method="post" action="addStudent.do">
      <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">
          </td>
        </tr>
        <tr>
          <td width="48%" align="right">学生号:</td>
          <td width="52%"><input name="student_number" type="text">
          </td>
        </tr>
        <tr>
          <td align="right">姓名:</td>
          <td><input name="name" type="text">
          </td>
        </tr>
        <tr>
          <td align="right">密码:</td>
          <td><input name="password" type="password" id="password" maxlength="10">
          </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">
          </td>
        </tr>
        <tr>
          <td align="right">联系电话:</td>
          <td><input type="text" name="telephone"></td>
        </tr>
         <tr>
          <td align="right">E-mail:</td>
          <td><input type="text" name="email"></td>
        </tr>
        <tr>
          <td align="right">地址:</td>
          <td><input type="text" name="address"></td>
        </tr>
        <tr>
          <td align="right">学生所在系:</td>
          <td><select name="department" size="1">
              <option>计算机</option>
              <option>机械系</option>
              <option>电子系</option>
              <option>数理系</option>
            </select>
          </td>
        </tr>
        <tr>
          <td align="right">请选择老师:</td>
          <td><select name="teacher_id">
            <option value="0">请选择</option>
			<%
                List result=HibernateUtil.getTeacher();
                Iterator it = result.iterator();
                while(it.hasNext()) {
                      Teacher teacher=(Teacher)it.next();
                    int id= (teacher.getId()).intValue();
                       String tea_username=teacher.getUsername();                     
             %>
             <option value="<%=id%>"><%=tea_username%></option>
             <% } %>
          </select></td>
        </tr>
        <tr>
          <td align="right">学分:</td>
          <td><input type="text" name="mark"></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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -