• 大小: 1.75MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-13
  • 语言: Java
  • 标签:

资源简介

JavaWeb教务管理系统

资源截图

代码片段和文件信息

package com.dw.controll;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dw.dao.StudentDao;
import com.dw.dao.impl.StudentDaoImpl;
import com.dw.model.Student;

/**
 * 控制层 -添加 逻辑处理
  @author DY1101shaoyuxian
 * 
 */
public class AddServlet extends HttpServlet {


private static final long serialVersionUID = 1L;

public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
this.doPost(request response);
}

public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
// Student(stIdstNamestSexstAgestTelstDeptstAddress)
String stName = request.getParameter(“stName“);
String stSex = request.getParameter(“stSex“);
String stAge = request.getParameter(“stAge“);
Long stTel = Long.parseLong(request.getParameter(“stTel“));
String stDept = request.getParameter(“stDept“);
String stAddress = request.getParameter(“stAddress“);
Student stu = new Student(stName stSex stAge stTel stDept
stAddress);
StudentDao studao = new StudentDaoImpl();
boolean flag = studao.addStudent(stu);
if (flag && !(stTel == null) && !““.equals(stTel)) {
request.setAttribute(“msg“ “添加成功!!“);
request.getRequestDispatcher(“main.jsp“).forward(request
response);
} else {
request.getRequestDispatcher(“main.jsp“).forward(request
response);
System.out.println(“添加失败!!“);
}

}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .......       998  2016-04-13 17:30  StudentManager\StudentManagerWeb\.classpath

    .......       324  2016-04-03 19:52  StudentManager\StudentManagerWeb\.mymetadata

    .......      1760  2016-04-03 19:52  StudentManager\StudentManagerWeb\.project

    .......       500  2014-07-21 16:12  StudentManager\StudentManagerWeb\.settings\.jsdtscope

    .......       395  2016-04-03 19:52  StudentManager\StudentManagerWeb\.settings\org.eclipse.jdt.core.prefs

    .......       489  2016-04-13 17:30  StudentManager\StudentManagerWeb\.settings\org.eclipse.wst.common.component

    .......       252  2016-04-03 19:52  StudentManager\StudentManagerWeb\.settings\org.eclipse.wst.common.project.facet.core.xml

    .......        49  2016-04-03 19:52  StudentManager\StudentManagerWeb\.settings\org.eclipse.wst.jsdt.ui.superType.container

    .......         6  2016-04-03 19:52  StudentManager\StudentManagerWeb\.settings\org.eclipse.wst.jsdt.ui.superType.name

    .......      1692  2016-04-03 22:34  StudentManager\StudentManagerWeb\src\com\dw\controll\AddServlet.java

    .......      1299  2016-04-03 22:34  StudentManager\StudentManagerWeb\src\com\dw\controll\DeleteServlet.java

    .......      4652  2016-04-16 19:08  StudentManager\StudentManagerWeb\src\com\dw\controll\LoginServlet.java

    .......      3929  2016-04-03 22:37  StudentManager\StudentManagerWeb\src\com\dw\controll\PreServlet.java

    .......      2036  2016-04-03 22:38  StudentManager\StudentManagerWeb\src\com\dw\controll\SearchByIdServlet.java

    .......      1205  2016-04-16 16:10  StudentManager\StudentManagerWeb\src\com\dw\controll\SearchServlet.java

    .......      1207  2016-04-03 22:38  StudentManager\StudentManagerWeb\src\com\dw\controll\ShowAllServlet.java

    .......      1596  2016-04-03 22:38  StudentManager\StudentManagerWeb\src\com\dw\controll\UpdateServlet.java

    .......      5302  2016-04-03 22:35  StudentManager\StudentManagerWeb\src\com\dw\dao\impl\StudentDaoImpl.java

    .......      1573  2016-04-16 18:42  StudentManager\StudentManagerWeb\src\com\dw\dao\impl\StudentUserDaoImpl.java

    .......      1524  2016-04-16 16:47  StudentManager\StudentManagerWeb\src\com\dw\dao\impl\UserDaoImpl.java

    .......       957  2016-04-03 22:28  StudentManager\StudentManagerWeb\src\com\dw\dao\StudentDao.java

    .......       456  2016-04-16 16:55  StudentManager\StudentManagerWeb\src\com\dw\dao\StudentUserDao.java

    .......       429  2016-04-03 22:21  StudentManager\StudentManagerWeb\src\com\dw\dao\UserDao.java

    .......      1197  2016-04-03 22:29  StudentManager\StudentManagerWeb\src\com\dw\filter\EncodingFilter.java

    .......      1811  2016-04-11 21:25  StudentManager\StudentManagerWeb\src\com\dw\model\Student.java

    .......       771  2016-04-16 18:42  StudentManager\StudentManagerWeb\src\com\dw\model\StudentUser.java

    .......       726  2016-04-11 21:35  StudentManager\StudentManagerWeb\src\com\dw\model\User.java

    .......      1678  2016-04-11 21:35  StudentManager\StudentManagerWeb\src\com\dw\util\DbConn.java

    .......       388  2016-04-03 22:33  StudentManager\StudentManagerWeb\src\com\dw\util\StringUtil.java

    .......       103  2016-04-03 19:57  StudentManager\StudentManagerWeb\src\db.properties

............此处省略103个文件信息

评论

共有 条评论