资源简介
灰常简单的Java学生成绩管理系统
效果展示:http://www.cnblogs.com/wenruo/p/6351787.html
代码片段和文件信息
package com.wenr.controller;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.wenr.dao.CourseDao;
import com.wenr.dao.StudentDao;
import com.wenr.model.Course;
import com.wenr.model.Student;
public class AdminServlet extends HttpServlet {
/**
* Constructor of the object.
*/
public AdminServlet() {
super();
}
/**
* Destruction of the servlet.
*/
public void destroy() {
super.destroy(); // Just puts “destroy“ string in log
// Put your code here
}
/**
* The doGet method of the servlet.
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
doPost(requestresponse);
}
/**
* The doPost method of the servlet.
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
request.setCharacterEncoding(“utf-8“);
response.setContentType(“text/html;charset=utf-8“);
String action = request.getParameter(“action“);
String path = request.getContextPath();
HttpSession session = request.getSession();
PrintWriter out = response.getWriter();
CourseDao courseDao = new CourseDao();
if (“delete“.equals(action)) {
// 删除课程
courseDao.deleteCourseById(Integer.parseInt(request.getParameter(“cid“)));
response.sendRedirect(“../adminSearchCourse.jsp“);
} else if (“update“.equals(action)) {
// 更新课程
Course course = new Course();
course.setCid(Integer.parseInt(request.getParameter(“cid“)));
course.setCname(request.getParameter(“cname“));
course.setCredit(Integer.parseInt(request.getParameter(“credit“)));
courseDao.updateCourse(course);
response.sendRedirect(“../adminSearchCourse.jsp“);
} else if (“addStudent“.equals(action)) {
Student student = new Student();
StudentDao studentDao = new StudentDao();
student.setSpwd(request.getParameter(“spwd“));
student.setSname(request.getParameter(“sname“));
studentDao.addStudent(student);
response.sendRedirect(“../adminAddStudent.jsp“);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-01-25 15:18 StudentAchievementManagementSystem\
文件 1093 2017-01-25 15:18 StudentAchievementManagementSystem\.classpath
文件 1084 2017-01-25 15:18 StudentAchievementManagementSystem\.project
目录 0 2017-01-26 20:18 StudentAchievementManagementSystem\.settings\
文件 564 2017-01-25 15:18 StudentAchievementManagementSystem\.settings\.jsdtscope
文件 74 2017-01-26 20:18 StudentAchievementManagementSystem\.settings\org.eclipse.core.resources.prefs
文件 364 2017-01-25 15:18 StudentAchievementManagementSystem\.settings\org.eclipse.jdt.core.prefs
文件 561 2017-01-25 15:18 StudentAchievementManagementSystem\.settings\org.eclipse.wst.common.component
文件 414 2017-01-25 15:18 StudentAchievementManagementSystem\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-01-25 15:18 StudentAchievementManagementSystem\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-01-25 15:18 StudentAchievementManagementSystem\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2017-01-26 19:00 StudentAchievementManagementSystem\src\
目录 0 2017-01-25 15:19 StudentAchievementManagementSystem\src\com\
目录 0 2017-01-26 19:43 StudentAchievementManagementSystem\src\com\wenr\
目录 0 2017-01-26 17:35 StudentAchievementManagementSystem\src\com\wenr\controller\
文件 3500 2017-01-26 16:58 StudentAchievementManagementSystem\src\com\wenr\controller\AdminServlet.java
文件 1827 2017-01-26 17:43 StudentAchievementManagementSystem\src\com\wenr\controller\LoginFilter.java
文件 4896 2017-01-26 17:41 StudentAchievementManagementSystem\src\com\wenr\controller\LoginServlet.java
文件 5015 2017-01-26 15:41 StudentAchievementManagementSystem\src\com\wenr\controller\StudentServlet.java
目录 0 2017-01-26 14:29 StudentAchievementManagementSystem\src\com\wenr\dao\
文件 4801 2017-01-26 15:20 StudentAchievementManagementSystem\src\com\wenr\dao\CourseDao.java
文件 6644 2017-01-25 15:53 StudentAchievementManagementSystem\src\com\wenr\dao\StudentDao.java
目录 0 2017-01-25 15:26 StudentAchievementManagementSystem\src\com\wenr\model\
文件 629 2017-01-25 15:30 StudentAchievementManagementSystem\src\com\wenr\model\Course.java
文件 472 2017-01-25 15:24 StudentAchievementManagementSystem\src\com\wenr\model\Student.java
目录 0 2017-01-25 15:40 StudentAchievementManagementSystem\src\com\wenr\util\
文件 780 2017-01-25 15:41 StudentAchievementManagementSystem\src\com\wenr\util\DBUtil.java
目录 0 2017-01-26 17:31 StudentAchievementManagementSystem\WebRoot\
文件 1992 2017-01-26 16:49 StudentAchievementManagementSystem\WebRoot\adminAddCourse.jsp
文件 1582 2017-01-26 16:54 StudentAchievementManagementSystem\WebRoot\adminAddStudent.jsp
文件 1354 2017-01-26 15:47 StudentAchievementManagementSystem\WebRoot\adminMain.jsp
............此处省略41个文件信息
相关资源
- java 考试报名系统(毕设)
- 在线音乐管理系统
- 车辆信息管理系统
- 学生管理系统源码+Tomcat7.rar
- 基于JavaEE的多用户学生信息管理系统
- 基于JavaWeb开发的简单车辆管理系统
- java+sql server 图书借阅管理系统源程序
- jsp实现对数据库的增删改查-.rar
- JSP化妆品销售网站.rar
- JAVA JSP人事工资管理系统
- JSP JAVA体育成绩管理系统
- java语言物流管理系统的设计与实现
- 网上购物系统(JavaBean+Servlet+jsp).z
- 一个学生信息管理系统,使用jsp+Ser
- 传智书城功能完整
- JAVA-最简单的图书管理系统-增删改查
- 生鲜超市管理系统JAVA+GUI+MYSQL.zip
- jsp+servlet+jdbc+mysql通讯录管理系统
- zw_jspservletjavabean实现的新闻发布系统
- zw_jspjsp图书管理系统源码.zip
- zw_完整的企业人力资源管理系统(S
- zw_web基于Java的图书馆管理系统.zip
- javaweb网上书城代码
- 点名系统网页开发
- Java web员工工资管理系统
- jsp struts2 mysql实现的Java web员工工资管
- 图书馆管理系统.zip
- j2ee的酒店管理系统
- 图书管理系统(java+mysql).zip
- 学生管理系统(增删改查)
评论
共有 条评论