资源简介
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个文件信息
相关资源
- DPM模型PedroF.Felzenszwalb.rar
- STM32_旋转倒立摆.rar
- Learning.GraphQL.pdf
- 多通道数据采集(LabVIEW).rar
- 两款打车软件项目源码.zip
- 单片机实验代码8次.zip
- Pygame游戏源代码:超级玛丽.rar
- WinEdt7注册机.rar
- png2jpg.zip
- ADAMSxxcljgou.7z
- YiTu_Crack.7z
- Saber仿真.pdf
- 安卓app实现前后台通信案例二手车交
- MvcMovie.zip
- computerOrganizationVirtualLab.rar
- FastReport4.2.zip
- 053597-01@www_wqbook_com_ebooks_20101227_05359
- VISIO.rar140258
- 线性系统理论程兆林马树萍.pdf
- 高校党建管理系统.pdf
- cleanmem_v2.4.3_setup.zip
- objModelLoading.rar
- 论文.zip
- 地理信息系统导论.pptx
- 2013.rar
- 会员管理软件单机汽车4S店版6.4Reg注册
- OkDataRecovery.rar
- game.zip
- 人件中英文版+人月神话+最后期限.r
- vc13.rar
评论
共有 条评论