资源简介
exam_2.0.zip

代码片段和文件信息
package com.wgh.action;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import com.wgh.actionForm.LessonForm;
import com.wgh.dao.LessonDAO;
public class Lesson extends Action {
private LessonDAO lessonDAO = null;
public Lesson() {
this.lessonDAO = new LessonDAO();
}
public ActionForward execute(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
String action = request.getParameter(“action“);
System.out.println(“获取的查询字符串:“ + action);
if (action == null || ““.equals(action)) {
return mapping.findForward(“error“);
} else if (“lessonQuery“.equals(action)) {
return lessonQuery(mapping form request response);
} else if (“lessonAdd“.equals(action)) {
return lessonAdd(mapping form request response);
} else if (“lessonDel“.equals(action)) {
return lessonDel(mapping form request response);
}else if(“selectLesson“.equals(action)){
return selectLesson(mapping form request response);
}else if(“ready“.equals(action)){
return ready(mapping form request response);
}
request.setAttribute(“error“ “操作失败!“);
return mapping.findForward(“error“);
}
// 查询课程信息
private ActionForward lessonQuery(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
request.setAttribute(“lessonQuery“ lessonDAO.query(0));
return mapping.findForward(“lessonQuery“);
}
// 添加课程
private ActionForward lessonAdd(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
LessonForm lessonForm = (LessonForm) form;
int ret = lessonDAO.insert(lessonForm);
System.out.println(“返回值ret:“ + ret);
if (ret == 1) {
return mapping.findForward(“lessonAdd“);
} else if (ret == 2) {
request.setAttribute(“error“ “该课程已经添加!“);
return mapping.findForward(“error“);
} else {
request.setAttribute(“error“ “添加课程失败!“);
return mapping.findForward(“error“);
}
}
// 删除课程
private ActionForward lessonDel(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
LessonForm lessonForm = (LessonForm) form;
int ret = lessonDAO.delete(lessonForm);
if (ret == 0) {
request.setAttribute(“error“ “删除课程失败!“);
return mapping.findForward(“error“);
} else {
return mapping.findForward(“lessonDel“);
}
}
//在线考试时选择课程
private ActionForward selectLesson(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
HttpSession session = request.getSession();
String stu=session.getAttribute(“student“).toString(); //获取学号
List list=lessonDAO.query(stu); //查询包括考试题目的课程列表,但不包括已经考过的科目
if(list.size()<1){
return mapping.findForward(“noenLesson“);
}else{
request.setAttribute(“lessonList“list);
return mapping.findForward(“selectLes
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 7129 2017-05-23 00:35 db_exam.sql
目录 0 2017-06-10 14:07 exam_2.0\
文件 727 2017-05-26 19:35 exam_2.0\.classpath
文件 1041 2017-05-26 19:25 exam_2.0\.project
目录 0 2017-05-26 19:25 exam_2.0\.settings\
文件 503 2017-05-26 19:25 exam_2.0\.settings\.jsdtscope
文件 364 2017-05-26 19:25 exam_2.0\.settings\org.eclipse.jdt.core.prefs
文件 476 2017-05-26 19:25 exam_2.0\.settings\org.eclipse.wst.common.component
文件 305 2017-05-26 19:25 exam_2.0\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-05-26 19:25 exam_2.0\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-05-26 19:25 exam_2.0\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2017-05-26 19:25 exam_2.0\build\
目录 0 2017-06-08 23:02 exam_2.0\build\classes\
目录 0 2017-06-08 23:02 exam_2.0\build\classes\com\
文件 110 2017-06-06 09:34 exam_2.0\build\classes\com\connDB.properties
目录 0 2017-06-08 23:02 exam_2.0\build\classes\com\wgh\
目录 0 2017-06-08 23:02 exam_2.0\build\classes\com\wgh\action\
目录 0 2017-06-08 23:02 exam_2.0\build\classes\com\wgh\actionForm\
文件 1064 2017-06-10 16:46 exam_2.0\build\classes\com\wgh\actionForm\LessonForm.class
文件 1125 2017-06-08 23:02 exam_2.0\build\classes\com\wgh\actionForm\ManagerForm.class
文件 599 2017-06-08 23:02 exam_2.0\build\classes\com\wgh\actionForm\MoreSelect.class
文件 771 2017-06-08 23:02 exam_2.0\build\classes\com\wgh\actionForm\QueryResultIfForm.class
文件 4558 2017-06-09 11:08 exam_2.0\build\classes\com\wgh\actionForm\QuestionsForm.class
文件 2366 2017-06-09 11:09 exam_2.0\build\classes\com\wgh\actionForm\StudentForm.class
文件 1552 2017-06-09 11:09 exam_2.0\build\classes\com\wgh\actionForm\StuResultForm.class
文件 1720 2017-06-09 11:10 exam_2.0\build\classes\com\wgh\actionForm\TaoTiForm.class
文件 3947 2017-06-11 00:21 exam_2.0\build\classes\com\wgh\action\Lesson.class
文件 4326 2017-06-08 23:02 exam_2.0\build\classes\com\wgh\action\Manager.class
文件 4145 2017-06-08 23:02 exam_2.0\build\classes\com\wgh\action\Questions.class
文件 933 2017-06-08 23:02 exam_2.0\build\classes\com\wgh\action\SelfRequestProcessor.class
文件 6982 2017-06-11 00:24 exam_2.0\build\classes\com\wgh\action\StartExam.class
............此处省略140个文件信息
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论