资源简介
基于java的师生管理系统,将数据库文件导入,即可使用。简单易上手
代码片段和文件信息
package ts.javaweb.cotroller;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.converters.IntegerConverter;
import ts.javaweb.domain.Course;
import ts.javaweb.domain.CourseCustom;
import ts.javaweb.domain.Teacher;
import ts.javaweb.service.CourseService;
import ts.javaweb.service.TeacherService;
import ts.javaweb.service.impl.CourseServiceImpl;
import ts.javaweb.service.impl.TeacherServiceImpl;
@WebServlet(“/courseServlet“)
public class CourseServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private CourseService courseService =new CourseServiceImpl();
private TeacherService teacherService=new TeacherServiceImpl();
public CourseServlet() {
super();
}
public void doGet(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
doPost(request response);
}
public void doPost(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
if(“showCourse“.equals(request.getParameter(“op“))){
this.showCourse(requestresponse);
}else if(“addUI“.equals(request.getParameter(“op“))){
this.addUI(requestresponse);
}else if(“add“.equals(request.getParameter(“op“))){
this.addCourse(requestresponse);
}else if(“updateUI“.equals(request.getParameter(“op“))){
this.updateUI(requestresponse);
}else if(“update“.equals(request.getParameter(“op“))){
this.update(request response);
}else if(“delete“.equals(request.getParameter(“op“))){
this.delete(requestresponse);
}else if(“showCourseByTid“.equals(request.getParameter(“op“))){
this.showCourseByTid(request response);
}else if(“chooseCourseUI“.equals(request.getParameter(“op“))){
this.chooseCourseUI(requestresponse);
}else if(“chooseCourse“.equals(request.getParameter(“op“))){
this.chooseCourse(requestresponse);
}else if(“dropCourseUI“.equals(request.getParameter(“op“))){
this.dropCourseUI(request response);
}else if(“dropCourse“.equals(request.getParameter(“op“))){
this.dropCourse(request response);
}
}
private void dropCourse(HttpServletRequest request
HttpServletResponse response) {
try {
this.courseService.dropCourse(Integer.parseInt(request.getParameter(“cid“)) Integer.parseInt(request.getParameter(“sid“)));
response.getWriter().write(“ript type=‘text/javascript‘>alert(‘退课成功‘) ript>“);
response.setHeader(“Refresh“ “0;URL=“+request.getContextPath()+“/courseServlet?op=dropCourseUI&sid=“+request.getParame
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 652 2016-04-09 14:46 teacher_student_manangement\.classpath
文件 354 2016-04-09 11:29 teacher_student_manangement\.myme
文件 1770 2016-04-09 17:14 teacher_student_manangement\.project
文件 500 2016-04-09 11:29 teacher_student_manangement\.settings\.jsdtscope
文件 395 2016-04-09 11:29 teacher_student_manangement\.settings\org.eclipse.jdt.core.prefs
文件 596 2016-04-09 11:33 teacher_student_manangement\.settings\org.eclipse.wst.common.component
文件 252 2016-04-09 11:29 teacher_student_manangement\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2016-04-09 11:29 teacher_student_manangement\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2016-04-09 11:29 teacher_student_manangement\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 66 2016-05-01 12:21 teacher_student_manangement\.tern-project
文件 1071 2016-04-09 11:34 teacher_student_manangement\config\dbcpconfig.properties
文件 7666 2016-04-10 20:48 teacher_student_manangement\src\ts\javaweb\cotroller\CourseServlet.java
文件 1137 2016-04-10 21:11 teacher_student_manangement\src\ts\javaweb\cotroller\loginOutServlet.java
文件 2827 2016-04-10 22:33 teacher_student_manangement\src\ts\javaweb\cotroller\LoginServlet.java
文件 4283 2016-04-10 16:50 teacher_student_manangement\src\ts\javaweb\cotroller\StudentServlet.java
文件 3748 2016-04-09 22:19 teacher_student_manangement\src\ts\javaweb\cotroller\TeacherServlet.java
文件 988 2016-04-10 20:15 teacher_student_manangement\src\ts\javaweb\dao\CourseDao.java
文件 2821 2016-04-10 20:16 teacher_student_manangement\src\ts\javaweb\dao\impl\CourseDaoImpl.java
文件 2210 2016-04-10 15:26 teacher_student_manangement\src\ts\javaweb\dao\impl\StudentDaoImpl.java
文件 2134 2016-04-10 16:08 teacher_student_manangement\src\ts\javaweb\dao\impl\TeacherDaoImpl.java
文件 672 2016-04-10 15:26 teacher_student_manangement\src\ts\javaweb\dao\StudentDao.java
文件 727 2016-04-10 15:25 teacher_student_manangement\src\ts\javaweb\dao\TeacherDao.java
文件 1056 2016-04-09 11:35 teacher_student_manangement\src\ts\javaweb\domain\Course.java
文件 193 2016-04-09 14:23 teacher_student_manangement\src\ts\javaweb\domain\CourseCustom.java
文件 1120 2016-04-10 12:01 teacher_student_manangement\src\ts\javaweb\domain\Student.java
文件 1511 2016-04-10 12:01 teacher_student_manangement\src\ts\javaweb\domain\Teacher.java
文件 1428 2016-04-10 20:39 teacher_student_manangement\src\ts\javaweb\filter\LoginFiler.java
文件 2084 2016-04-09 16:39 teacher_student_manangement\src\ts\javaweb\filter\SetAllCharacterEncodingFilter.java
文件 812 2016-04-10 20:17 teacher_student_manangement\src\ts\javaweb\service\CourseService.java
文件 2216 2016-04-10 20:17 teacher_student_manangement\src\ts\javaweb\service\impl\CourseServiceImpl.java
............此处省略272个文件信息
- 上一篇:哈夫曼编码压缩程序Java
- 下一篇:servlet定时器功能完整版已测试过
评论
共有 条评论