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

📄 stu_005fmanage_jsp.java

📁 基于b/s模式的jsp在线考试系统
💻 JAVA
字号:
package org.apache.jsp.teacher;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.gton.bean.UserBean;
import java.util.ArrayList;

public final class stu_005fmanage_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=GBK");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n\r\n\r\n<html>\r\n<head>\r\n<title>\r\nstu_manage\r\n</title>\r\n</head>\r\n");

  UserBean bean = new UserBean();
  ArrayList list = bean.getAllStu();

      out.write("\r\n<body bgcolor=\"#ffffff\">\r\n<center>\r\n  <table border=\"1\">\r\n    <tr>\r\n      <th width=\"80\">学生姓名</th>\r\n      <th width=\"80\">密码</th>\r\n      <th width=\"80\">年龄</th>\r\n      <th width=\"80\">性别</th>\r\n      <th width=\"80\">学号</th>\r\n      <th width=\"80\">所属学院</th>\r\n      <th width=\"80\">民族</th>\r\n      <th width=\"100\">操作</th>\r\n    </tr>\r\n     ");

    for (int i = 0; i < list.size(); i++) {
      bean = (UserBean)list.get(i);
  
      out.write("\r\n    <tr>\r\n      <td>");
      out.print(bean.getUsers_Name() );
      out.write("      </td>\r\n      <td>");
      out.print(bean.getUsers_Pwd() );
      out.write("      </td>\r\n      <td>");
      out.print(bean.getUsers_Age() );
      out.write("      </td>\r\n    ");
if (bean.getUsers_Sex() == 1) {    
      out.write("\r\n      <td>男</td>\r\n    ");
} else {    
      out.write("\r\n      <td>女</td>\r\n    ");
}    
      out.write("\r\n      <td>");
      out.print(bean.getUsers_No() );
      out.write("      </td>\r\n      <td>");
      out.print(bean.getUsers_Agent() );
      out.write("      </td>\r\n      <td>");
      out.print(bean.getUsers_Mz() );
      out.write("      </td>\r\n      <td>\r\n        <a href=\"/student/deletestu?sid=");
      out.print(bean.getUsers_ID());
      out.write("\">删除</a>&nbsp; |\r\n        <a href=\"/student/modifystu?sid=");
      out.print(bean.getUsers_ID());
      out.write("\">修改</a>\r\n      </td>\r\n    </tr>\r\n  ");
}  
      out.write("\r\n  </table>\r\n\r\n   <br /><hr />\r\n  <h3>按姓名查询学生信息</h3>\r\n  <form action=\"/student/selectstu\" method=\"POST\">\r\n    请输入学生姓名:<input type=\"text\" name=\"name\" />\r\n    &nbsp;&nbsp;&nbsp;\r\n    <input type=\"submit\" value=\"查询\" />\r\n  </form>\r\n\r\n  ");

   if(session.getAttribute("student") != null){
     UserBean student = (UserBean)session.getAttribute("student");
     session.removeAttribute("student");
  
      out.write("\r\n  <table border=\"1\">\r\n    <tr>\r\n      <th width=\"80\">学生姓名</th>\r\n      <th width=\"80\">学生密码</th>\r\n      <th width=\"80\">年龄</th>\r\n      <th width=\"80\">性别</th>\r\n      <th width=\"80\">学号</th>\r\n      <th width=\"80\">所属学院</th>\r\n      <th width=\"80\">民族</th>\r\n      <th width=\"100\">操作</th>\r\n    </tr>\r\n    <tr>\r\n      <td>");
      out.print(student.getUsers_Name() );
      out.write("</td>\r\n      <td>");
      out.print(student.getUsers_Pwd() );
      out.write("</td>\r\n      <td>");
      out.print(student.getUsers_Age() );
      out.write("</td>\r\n      ");
if (student.getUsers_Sex() == 1) {    
      out.write("\r\n      <td>男</td>\r\n      ");
} else {    
      out.write("\r\n      <td>女</td>\r\n      ");
}    
      out.write("\r\n      <td>");
      out.print(student.getUsers_No() );
      out.write("</td>\r\n      <td>");
      out.print(student.getUsers_Agent() );
      out.write("</td>\r\n      <td>");
      out.print(student.getUsers_Mz() );
      out.write("</td>\r\n      <td>\r\n        <a href=\"/student/deletestu?sid=");
      out.print(bean.getUsers_ID());
      out.write("\">删除</a>&nbsp; |\r\n        <a href=\"/student/modifystu?sid=");
      out.print(bean.getUsers_ID());
      out.write("\">修改</a>\r\n      </td>\r\n    </tr>\r\n  </table>\r\n  ");
 } 
      out.write("\r\n</center>\r\n</body>\r\n</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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