IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> Java知识库 -> IDEA+Java+SSH+Bootstrap+Mysql实现在线考试系统(含论文) -> 正文阅读

[Java知识库]IDEA+Java+SSH+Bootstrap+Mysql实现在线考试系统(含论文)

?

一、系统介绍


1.开发环境

开发工具:IDEA2018.2

JDK版本:jdk1.8

Mysql版本:8.0.13


2.技术选型

1.后端:使用Java+SSH进行开发,使用过滤器来验证用户是否登录,使用MVC进行分层。

2.数据库:使用Hibernate作为数据持久化框架。

3.前端:使用Bootstrap作为前端框架来开发,使用到jstl来遍历数据。jsp来展示页面。

3.系统功能

1.学生

1.在线开始

2.成绩查询

3.修改密码

2.管理员

1.学生信息管理

考生信息的增删改查

2.考试成绩查询

3.试卷信息管理

试卷的增删改查

4.试题信息管理

试题信息的增删改查

4.数据库

/*
 Navicat Premium Data Transfer

 Source Server         : Mysql
 Source Server Type    : MySQL
 Source Server Version : 80013
 Source Host           : localhost:3306
 Source Schema         : ssh_online_exam

 Target Server Type    : MySQL
 Target Server Version : 80013
 File Encoding         : 65001

 Date: 11/07/2021 02:00:10
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_exam
-- ----------------------------
DROP TABLE IF EXISTS `t_exam`;
CREATE TABLE `t_exam`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `examDate` datetime(0) NULL DEFAULT NULL,
  `moreScore` int(11) NOT NULL,
  `score` int(11) NOT NULL,
  `singleScore` int(11) NOT NULL,
  `paperId` int(11) NULL DEFAULT NULL,
  `studentId` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `FK_l14kkd2w86mpy8v2snw37hskx`(`paperId`) USING BTREE,
  INDEX `FK_sl2v4qucyp0qe9yvnk6icka10`(`studentId`) USING BTREE,
  CONSTRAINT `FK_l14kkd2w86mpy8v2snw37hskx` FOREIGN KEY (`paperId`) REFERENCES `t_paper` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_sl2v4qucyp0qe9yvnk6icka10` FOREIGN KEY (`studentId`) REFERENCES `t_student` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_exam
-- ----------------------------
INSERT INTO `t_exam` VALUES (25, '2021-06-30 15:42:37', 0, 40, 40, 1, 'JS1001');

-- ----------------------------
-- Table structure for t_manager
-- ----------------------------
DROP TABLE IF EXISTS `t_manager`;
CREATE TABLE `t_manager`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `userName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_manager
-- ----------------------------
INSERT INTO `t_manager` VALUES (1, '管理员', 'admin', 'admin');

-- ----------------------------
-- Table structure for t_paper
-- ----------------------------
DROP TABLE IF EXISTS `t_paper`;
CREATE TABLE `t_paper`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `joinDate` datetime(0) NULL DEFAULT NULL,
  `paperName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_paper
-- ----------------------------
INSERT INTO `t_paper` VALUES (1, '2014-01-01 00:00:00', 'Java试卷一');
INSERT INTO `t_paper` VALUES (2, '2014-02-01 00:00:00', '语文试卷二');
INSERT INTO `t_paper` VALUES (3, '2014-01-01 00:00:00', '数学试卷一');

-- ----------------------------
-- Table structure for t_question
-- ----------------------------
DROP TABLE IF EXISTS `t_question`;
CREATE TABLE `t_question`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `answer` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `joinTime` datetime(0) NULL DEFAULT NULL,
  `optionA` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `optionB` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `optionC` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `optionD` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `subject` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `paperId` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `FK_ebouwob97chiilpjmc6gtgwkw`(`paperId`) USING BTREE,
  CONSTRAINT `FK_ebouwob97chiilpjmc6gtgwkw` FOREIGN KEY (`paperId`) REFERENCES `t_paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_question
-- ----------------------------
INSERT INTO `t_question` VALUES (1, 'D', '2014-01-01 00:00:00', 'A. a1', 'B. $1', 'C. _1', 'D .11', '下列不可作为java语言修饰符的是?', '1', 1);
INSERT INTO `t_question` VALUES (2, 'A', '2014-01-01 00:00:00', 'A. a1.java', 'B. a.class', 'C. a1', 'D. 都可以', '有一段java应用程序,它的主类名是a1,那么保存 它的源文件名可以是?', '1', 1);
INSERT INTO `t_question` VALUES (3, 'A,B', '2014-01-01 00:00:00', 'A. String []a', 'B. String a[]', 'C. char a[][]', 'D. String a[10]', '下面正确声明一个一维数组的是?', '2', 1);
INSERT INTO `t_question` VALUES (4, 'A,D', '2014-01-01 00:00:00', 'A. 在java中只允许单继承。', 'B. 在java中一个类只能实现一个接口。', 'C. 在java中一个类不能同时继承一个类和实现一个接口。', 'D. java的单一继承使代码更可靠。', '下面关于继承的叙述哪些是正确的?', '2', 1);
INSERT INTO `t_question` VALUES (5, 'C', '2014-01-01 00:00:00', 'A. 一个子类可以有多个父类,一个父类也可以有多个子类', 'B. 一个子类可以有多个父类,但一个父类只可以有一个子类', 'C. 一个子类可以有一个父类,但一个父类可以有多个子类', 'D. 上述说法都不对', '在Java中?', '1', 1);
INSERT INTO `t_question` VALUES (6, 'A,D', '2014-01-01 00:00:00', 'A. 包的声明必须是源文件的第一句代码。', 'B. 包的声明必须紧跟在import语句的后面。', 'C. 只有公共类才能放在包中。', 'D. 可以将多个源文件中的类放在同一个包中。', '可以将多个源文件中的类放在同一个包中?', '2', 1);
INSERT INTO `t_question` VALUES (7, 'C', '2014-01-01 00:00:00', 'A. Java是跨平台的编程语言', 'B. Java支持分布式计算', 'C. Java是面向过程的编程语言', 'D. Java是面向对象的编程语言', '下列关于Java语言的特点,描述错误的是?', '1', 1);
INSERT INTO `t_question` VALUES (21, 'D', '2021-06-29 16:00:00', '1', '2', '3', '4', 'Java基础类有几个?', '1', 1);

-- ----------------------------
-- Table structure for t_student
-- ----------------------------
DROP TABLE IF EXISTS `t_student`;
CREATE TABLE `t_student`  (
  `id` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `cardNo` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `prefession` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `sex` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_student
-- ----------------------------
INSERT INTO `t_student` VALUES ('JS1001', '1001', '张三', '123456', '计算机科学', '男');
INSERT INTO `t_student` VALUES ('JS1002', '1002', '李四', '123456', '软件工程', '男');
INSERT INTO `t_student` VALUES ('JS1003', '1003', '王五', '123456', '网络攻防', '女');

SET FOREIGN_KEY_CHECKS = 1;

5.工程截图

二、系统展示

1.学生-登录页面

2.学生-主页面

3.学生-在线考试

4.学生-成绩查询

5.学生-修改密码

6.管理员-登录页面

7.管理员-主页面

8.管理员-考生信息管理

9.管理员-考生成绩查询

10.管理员-试卷管理

11.管理员-题目管理

三、部分代码

ExamAction

package com.java.yzl.action;
//考试Action类

import com.java.yzl.actionInter.ExamActionInter;
import com.java.yzl.bean.Exam;
import com.java.yzl.bean.PageBean;
import com.java.yzl.bean.Question;
import com.java.yzl.dao.ExamDao;
import com.java.yzl.dao.QuestionDao;
import com.java.yzl.util.PageUtil;
import com.java.yzl.util.PropertiesUtil;
import com.java.yzl.util.StringUtil;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.ServletRequestAware;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.*;
import java.util.Map.Entry;

public class ExamAction extends ActionSupport implements ServletRequestAware, ExamActionInter {

    private static final long serialVersionUID = 1L;

    private ExamDao examDao = new ExamDao();
    private QuestionDao questionDao = new QuestionDao();
    private HttpServletRequest request;

    private String mainPage;
    private Exam exam;
    private Exam s_exam;
    private List<Exam> examList;
    private String page;
    private int total;
    private String pageCode;

    public String getMainPage() {
        return mainPage;
    }

    public void setMainPage(String mainPage) {
        this.mainPage = mainPage;
    }

    public Exam getExam() {
        return exam;
    }

    public void setExam(Exam exam) {
        this.exam = exam;
    }


    public List<Exam> getExamList() {
        return examList;
    }

    public void setExamList(List<Exam> examList) {
        this.examList = examList;
    }


    public Exam getS_exam() {
        return s_exam;
    }

    public void setS_exam(Exam s_exam) {
        this.s_exam = s_exam;
    }


    public String getPage() {
        return page;
    }

    public void setPage(String page) {
        this.page = page;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public String getPageCode() {
        return pageCode;
    }

    public void setPageCode(String pageCode) {
        this.pageCode = pageCode;
    }

    /**
     * 计算/添加考试成绩
     *
     * @return
     * @throws Exception
     */
    public String add() throws Exception {
        Map<String, String[]> keyMap = new HashMap<String, String[]>();
        keyMap = request.getParameterMap();
        Iterator<Entry<String, String[]>> it2 = keyMap.entrySet().iterator();
        int totalScore = 0;
        int singleScore = 0;
        int moreScore = 0;
        while (it2.hasNext()) {
            Entry<String, String[]> entry = it2.next();
            String keyStr = entry.getKey();
            String values[] = entry.getValue();
            String key;
            String value = "";
            if (keyStr.equals("exam.student.id") || keyStr.equals("exam.paper.id")) {
                continue;
            }
            if (keyStr.split("-")[1].equals("r")) {  // 单选
                key = keyStr.split("-")[2];
                value = values[0];
                singleScore += this.calScore(key, value, "1");
            } else {  // 多选
                key = keyStr.split("-")[2];
                for (String s : values) {
                    value += s + ",";
                }
                value = value.substring(0, value.length() - 1);
                moreScore += this.calScore(key, value, "2");
            }
        }
        totalScore = singleScore + moreScore;
        exam.setSingleScore(singleScore);
        exam.setMoreScore(moreScore);
        exam.setScore(totalScore);
        exam.setExamDate(new Date());
        examDao.saveExam(exam);
        mainPage = "exam/examResult.jsp";
        return SUCCESS;
    }

    /**
     * 计算每道题目的得分
     *
     * @param questionId
     * @param userAnswer
     * @return
     */
    private int calScore(String questionId, String userAnswer, String type) throws Exception {
        Question question = questionDao.getQuestion(questionId);
        if (userAnswer.equals(question.getAnswer())) {
            if ("1".equals(type)) {
                return 20;
            } else {
                return 30;
            }
        } else {
            return 0;
        }
    }

    /**
     * 获取考试成绩
     *
     * @return
     * @throws Exception
     */
    public String getExams() throws Exception {
        examList = examDao.getExams(s_exam, null);
        mainPage = "exam/myExam.jsp";
        return SUCCESS;
    }

    /**
     * 获取所有考试成绩
     *
     * @return
     * @throws Exception
     */
    public String examList() throws Exception {
        HttpSession session = request.getSession();
        if (StringUtil.isEmpty(page)) {
            page = "1";
        }
        if (s_exam != null) {
            session.setAttribute("s_exam", s_exam);
        } else {
            Object o = session.getAttribute("s_exam");
            if (o != null) {
                s_exam = (Exam) o;
            } else {
                s_exam = new Exam();
            }
        }
        PageBean pageBean = new PageBean(Integer.parseInt(page), Integer.parseInt(PropertiesUtil.getValue("pageSize")));
        examList = examDao.getExams(s_exam, pageBean);
        total = examDao.examCount(s_exam);
        pageCode = PageUtil.genPagation(request.getContextPath() + "/exam!examList", total, Integer.parseInt(page), Integer.parseInt(PropertiesUtil.getValue("pageSize")));
        mainPage = "exam/examList.jsp";
        return SUCCESS;
    }

    public void setServletRequest(HttpServletRequest request) {
        this.request = request;
    }
}

ManagerAction

package com.java.yzl.action;

import com.java.yzl.bean.Manager;
import com.java.yzl.dao.ManagerDao;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.ServletRequestAware;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class ManagerAction extends ActionSupport implements ServletRequestAware {

    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private HttpServletRequest request;

    private ManagerDao managerDao = new ManagerDao();

    private Manager manager;
    private String error;

    public Manager getManager() {
        return manager;
    }

    public void setManager(Manager manager) {
        this.manager = manager;
    }


    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    /**
     * 登录验证
     *
     * @return
     * @throws Exception
     */
    public String login() throws Exception {
        HttpSession session = request.getSession();
        Manager currentUser = managerDao.login(manager);
        if (currentUser == null) {
            error = "用户名或者密码错误!";
            return ERROR;
        } else {
            session.setAttribute("currentUser", currentUser);
            return SUCCESS;
        }
    }

    /**
     * 注销用户
     *
     * @throws Exception
     */
    public String logout() throws Exception {
        request.getSession().invalidate();
        return "logout";
    }

    public void setServletRequest(HttpServletRequest request) {
        this.request = request;
    }

}

PaperAction

package com.java.yzl.action;

import com.java.yzl.bean.Paper;
import com.java.yzl.bean.Question;
import com.java.yzl.dao.PaperDao;
import com.java.yzl.dao.QuestionDao;
import com.java.yzl.util.ResponseUtil;
import com.java.yzl.util.StringUtil;
import com.opensymphony.xwork2.ActionSupport;
import net.sf.json.JSONObject;
import org.apache.struts2.ServletActionContext;

import java.util.*;

/**
 * 试卷Action类
 *
 * @author Administrator
 */
public class PaperAction extends ActionSupport {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private PaperDao paperDao = new PaperDao();
    private QuestionDao questionDao = new QuestionDao();

    private String mainPage;
    private String paperId;

    private List<Paper> paperList = new ArrayList<Paper>();
    private List<Question> squestionList = new ArrayList<Question>();
    private List<Question> mquestionList = new ArrayList<Question>();

    private String title; // 标题


    private Paper paper;

    public List<Paper> getPaperList() {
        return paperList;
    }

    public void setPaperList(List<Paper> paperList) {
        this.paperList = paperList;
    }


    public List<Question> getSquestionList() {
        return squestionList;
    }

    public void setSquestionList(List<Question> squestionList) {
        this.squestionList = squestionList;
    }

    public List<Question> getMquestionList() {
        return mquestionList;
    }

    public void setMquestionList(List<Question> mquestionList) {
        this.mquestionList = mquestionList;
    }

    public Paper getPaper() {
        return paper;
    }

    public void setPaper(Paper paper) {
        this.paper = paper;
    }

    public String getPaperId() {
        return paperId;
    }

    public void setPaperId(String paperId) {
        this.paperId = paperId;
    }

    public String getMainPage() {
        return mainPage;
    }

    public void setMainPage(String mainPage) {
        this.mainPage = mainPage;
    }


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * 获取所有试卷
     *
     * @return
     * @throws Exception
     */
    public String list() throws Exception {
        paperList = paperDao.getPapers();
        mainPage = "exam/selectPaper.jsp";
        return SUCCESS;
    }

    /**
     * 获取所有试卷(管理)
     *
     * @return
     * @throws Exception
     */
    public String paperList() throws Exception {
        paperList = paperDao.getPapers();
        mainPage = "paper/paperList.jsp";
        return SUCCESS;
    }

    /**
     * 通过id获取试卷实体
     *
     * @return
     * @throws Exception
     */
    public String getPaperById() throws Exception {
        paper = paperDao.getPaper(paperId);
        mainPage = "paper/paperSave.jsp";
        return SUCCESS;
    }

    /**
     * 保存预操作
     *
     * @return
     * @throws Exception
     */
    public String preSave() throws Exception {
        if (StringUtil.isNotEmpty(paperId)) {
            paper = paperDao.getPaper(paperId);
            title = "修改试卷";
        } else {
            title = "添加试卷";
        }
        mainPage = "paper/paperSave.jsp";
        return SUCCESS;
    }

    /**
     * 保存试卷
     *
     * @return
     * @throws Exception
     */
    public String savePaper() throws Exception {
        if (StringUtil.isNotEmpty(paperId)) {
            paper.setId(Integer.parseInt(paperId));
        } else {
            paper.setJoinDate(new Date());
        }
        paperDao.savePaper(paper);
        return "save";
    }

    /**
     * 删除试卷
     *
     * @return
     * @throws Exception
     */
    public String deletePaper() throws Exception {
        paper = paperDao.getPaper(paperId);
        JSONObject resultJson = new JSONObject();
        if (questionDao.existQuestionByPaperId(paperId)) {
            resultJson.put("error", "试卷下面有题目,不能删除");
        } else {
            paperDao.paperDelete(paper);
            resultJson.put("success", true);
        }
        ResponseUtil.write(resultJson, ServletActionContext.getResponse());
        return null;
    }

    /**
     * 获取指定试卷
     *
     * @return
     * @throws Exception
     */
    public String getDetailPaper() throws Exception {
        paper = paperDao.getPaper(paperId);
        Set<Question> questionList = paper.getQuestions();
        Iterator<Question> it = questionList.iterator();
        while (it.hasNext()) {
            Question q = it.next();
            if ("1".equals(q.getType())) {
                squestionList.add(q);
            } else {
                mquestionList.add(q);
            }
        }
        squestionList = this.getRandomQuestion(squestionList, 3);
        mquestionList = this.getRandomQuestion(mquestionList, 2);
        mainPage = "exam/paper.jsp";
        return SUCCESS;
    }

    /**
     * 获取随机试题
     *
     * @param questionList
     * @param num
     * @return
     */
    private List<Question> getRandomQuestion(List<Question> questionList, int num) {
        List<Question> resultList = new ArrayList<Question>();
        Random random = new Random();
        if (num > 0) {
            for (int i = 1; i <= num; i++) {
                int n = random.nextInt(questionList.size());
                Question q = questionList.get(n);
                if (resultList.contains(q)) {
                    i--;
                } else {
                    resultList.add(questionList.get(n));
                }
            }
        }
        return resultList;
    }

}

QuestionAction

package com.java.yzl.action;


import com.java.yzl.bean.PageBean;
import com.java.yzl.bean.Paper;
import com.java.yzl.bean.Question;
import com.java.yzl.dao.PaperDao;
import com.java.yzl.dao.QuestionDao;
import com.java.yzl.util.PageUtil;
import com.java.yzl.util.PropertiesUtil;
import com.java.yzl.util.ResponseUtil;
import com.java.yzl.util.StringUtil;
import com.opensymphony.xwork2.ActionSupport;
import net.sf.json.JSONObject;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.ServletRequestAware;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

public class QuestionAction extends ActionSupport implements ServletRequestAware {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private HttpServletRequest request;

    private QuestionDao questionDao = new QuestionDao();
    private PaperDao paperDao = new PaperDao();

    private List<Question> questionList;
    private List<Paper> paperList;
    private String mainPage;

    private String questionId;
    private Question question;
    private String title;

    private String page;
    private int total;
    private String pageCode;

    private Question s_question;


    public List<Paper> getPaperList() {
        return paperList;
    }

    public void setPaperList(List<Paper> paperList) {
        this.paperList = paperList;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<Question> getQuestionList() {
        return questionList;
    }

    public void setQuestionList(List<Question> questionList) {
        this.questionList = questionList;
    }

    public String getMainPage() {
        return mainPage;
    }

    public void setMainPage(String mainPage) {
        this.mainPage = mainPage;
    }

    public String getPage() {
        return page;
    }

    public void setPage(String page) {
        this.page = page;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public String getPageCode() {
        return pageCode;
    }

    public void setPageCode(String pageCode) {
        this.pageCode = pageCode;
    }


    public Question getS_question() {
        return s_question;
    }

    public void setS_question(Question s_question) {
        this.s_question = s_question;
    }


    public String getQuestionId() {
        return questionId;
    }

    public void setQuestionId(String questionId) {
        this.questionId = questionId;
    }

    public Question getQuestion() {
        return question;
    }

    public void setQuestion(Question question) {
        this.question = question;
    }

    /**
     * 查询试题信息
     *
     * @return
     * @throws Exception
     */
    public String list() throws Exception {
        HttpSession session = request.getSession();
        if (StringUtil.isEmpty(page)) {
            page = "1";
        }
        if (s_question != null) {
            session.setAttribute("s_question", s_question);
        } else {
            Object o = session.getAttribute("s_question");
            if (o != null) {
                s_question = (Question) o;
            } else {
                s_question = new Question();
            }
        }
        PageBean pageBean = new PageBean(Integer.parseInt(page), Integer.parseInt(PropertiesUtil.getValue("pageSize")));
        questionList = questionDao.getQuestions(s_question, pageBean);
        total = questionDao.questionCount(s_question);
        pageCode = PageUtil.genPagation(request.getContextPath() + "/question!list", total, Integer.parseInt(page), Integer.parseInt(PropertiesUtil.getValue("pageSize")));
        mainPage = "question/questionList.jsp";
        return SUCCESS;
    }

    /**
     * 通过id获取试题
     *
     * @return
     * @throws Exception
     */
    public String getQuestionById() throws Exception {
        question = questionDao.getQuestion(questionId);
        mainPage = "question/questionShow.jsp";
        return SUCCESS;
    }

    /**
     * 预编辑操作
     *
     * @return
     * @throws Exception
     */
    public String preSave() throws Exception {
        paperList = paperDao.getPapers();
        if (StringUtil.isNotEmpty(questionId)) {
            question = questionDao.getQuestion(questionId);
            title = "修改试题信息";
        } else {
            title = "添加试题信息";
        }
        mainPage = "question/questionSave.jsp";
        return SUCCESS;
    }

    /**
     * 删除试题
     *
     * @return
     * @throws Exception
     */
    public String delete() throws Exception {
        question = questionDao.getQuestion(questionId);
        questionDao.deleteQuestion(question);
        JSONObject resultJson = new JSONObject();
        resultJson.put("success", true);
        ResponseUtil.write(resultJson, ServletActionContext.getResponse());
        return null;
    }

    /**
     * 保存试题
     *
     * @return
     * @throws Exception
     */
    public String saveQuestion() throws Exception {
        if (StringUtil.isNotEmpty(questionId)) {
            question.setId(Integer.parseInt(questionId));
        }
        questionDao.saveQuestion(question);
        return "save";
    }

    public void setServletRequest(HttpServletRequest request) {
        this.request = request;
    }

}

StudentAction

package com.java.yzl.action;


import com.java.yzl.bean.PageBean;
import com.java.yzl.bean.Student;
import com.java.yzl.dao.StudentDao;
import com.java.yzl.util.*;
import com.opensymphony.xwork2.ActionSupport;
import net.sf.json.JSONObject;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.ServletRequestAware;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * 学生Action类
 *
 * @author Administrator
 */
public class StudentAction extends ActionSupport implements ServletRequestAware {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private StudentDao studentDao = new StudentDao();
    private HttpServletRequest request;

    private String mainPage;

    private Student student;
    private String error;

    private String page;
    private int total;
    private String pageCode;

    private List<Student> studentList;

    private Student s_student;

    private String id;  // 学生编号

    private String title; // 标题

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public String getMainPage() {
        return mainPage;
    }

    public void setMainPage(String mainPage) {
        this.mainPage = mainPage;
    }


    public String getPageCode() {
        return pageCode;
    }

    public void setPageCode(String pageCode) {
        this.pageCode = pageCode;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public String getPage() {
        return page;
    }

    public void setPage(String page) {
        this.page = page;
    }

    public Student getS_student() {
        return s_student;
    }

    public void setS_student(Student s_student) {
        this.s_student = s_student;
    }

    public List<Student> getStudentList() {
        return studentList;
    }

    public void setStudentList(List<Student> studentList) {
        this.studentList = studentList;
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * 登录验证
     *
     * @return
     * @throws Exception
     */
    public String login() throws Exception {
        HttpSession session = request.getSession();
        Student currentUser = studentDao.login(student);
        if (currentUser == null) {
            error = "准考证号或者密码错误!";
            return ERROR;
        } else {
            session.setAttribute("currentUser", currentUser);
            return SUCCESS;
        }
    }

    /**
     * 修改密码预操作
     *
     * @return
     * @throws Exception
     */
    public String preUpdatePassword() throws Exception {
        mainPage = "student/updatePassword.jsp";
        return SUCCESS;
    }

    /**
     * 修改密码
     *
     * @return
     * @throws Exception
     */
    public String updatePassword() throws Exception {
        Student s = studentDao.getStudentById(student.getId());
        s.setPassword(student.getPassword());
        studentDao.saveStudent(s);
        mainPage = "student/updateSuccess.jsp";
        return SUCCESS;
    }

    /**
     * 查询学生信息
     *
     * @return
     * @throws Exception
     */
    public String list() throws Exception {
        HttpSession session = request.getSession();
        if (StringUtil.isEmpty(page)) {
            page = "1";
        }
        if (s_student != null) {
            session.setAttribute("s_student", s_student);
        } else {
            Object o = session.getAttribute("s_student");
            if (o != null) {
                s_student = (Student) o;
            } else {
                s_student = new Student();
            }
        }
        PageBean pageBean = new PageBean(Integer.parseInt(page), Integer.parseInt(PropertiesUtil.getValue("pageSize")));
        studentList = studentDao.getStudents(s_student, pageBean);
        total = studentDao.studentCount(s_student);
        pageCode = PageUtil.genPagation(request.getContextPath() + "/student!list", total, Integer.parseInt(page), Integer.parseInt(PropertiesUtil.getValue("pageSize")));
        mainPage = "student/studentList.jsp";
        return SUCCESS;
    }

    /**
     * 获取学生
     *
     * @return
     * @throws Exception
     */
    public String getStudentById() throws Exception {
        student = studentDao.getStudent(id);
        mainPage = "student/studentSave.jsp";
        return SUCCESS;
    }

    /**
     * 保存学生
     *
     * @return
     * @throws Exception
     */
    public String saveStudent() throws Exception {
        if (StringUtil.isEmpty(student.getId())) {
            student.setId("JS" + DateUtil.getCurrentDateStr());
        }
        studentDao.saveStudent(student);
        return "save";
    }

    /**
     * 删除学生
     *
     * @return
     * @throws Exception
     */
    public String deleteStudent() throws Exception {
        student = studentDao.getStudent(id);
        studentDao.studentDelete(student);
        JSONObject resultJson = new JSONObject();
        resultJson.put("success", true);
        ResponseUtil.write(resultJson, ServletActionContext.getResponse());
        return null;
    }

    /**
     * 预添加操作
     *
     * @return
     * @throws Exception
     */
    public String preSave() throws Exception {
        if (StringUtil.isNotEmpty(id)) {
            student = studentDao.getStudent(id);
            title = "修改学生信息";
        } else {
            title = "添加学生信息";
        }
        mainPage = "student/studentSave.jsp";
        return SUCCESS;
    }

    /**
     * 注销用户
     *
     * @throws Exception
     */
    public String logout() throws Exception {
        request.getSession().invalidate();
        return "logout";
    }

    public void setServletRequest(HttpServletRequest request) {
        this.request = request;
    }


}

ExamDao

package com.java.yzl.dao;

import com.java.yzl.bean.Exam;
import com.java.yzl.bean.PageBean;
import com.java.yzl.daoInter.ExamDaoInter;
import com.java.yzl.util.HibernateUtil;
import com.java.yzl.util.StringUtil;
import org.hibernate.Query;
import org.hibernate.Session;

import java.math.BigInteger;
import java.util.List;


public class ExamDao implements ExamDaoInter {

    // 保存考试信息
    public void saveExam(Exam exam) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.merge(exam);
        session.getTransaction().commit();
    }

    //获取考试信息
    public List<Exam> getExams(Exam s_exam, PageBean pageBean) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        StringBuffer hql = new StringBuffer("from Exam exam");
        if (s_exam.getStudent() != null && StringUtil.isNotEmpty(s_exam.getStudent().getId())) {
            hql.append(" and exam.student.id like '%" + s_exam.getStudent().getId() + "%'");
        }
        if (s_exam.getStudent() != null && StringUtil.isNotEmpty(s_exam.getStudent().getName())) {
            hql.append(" and exam.student.name like '%" + s_exam.getStudent().getName() + "%'");
        }
        Query query = session.createQuery(hql.toString().replaceFirst("and", "where"));
        if (pageBean != null) {
            query.setFirstResult(pageBean.getStart());
            query.setMaxResults(pageBean.getPageSize());
        }
        @SuppressWarnings("unchecked")
        List<Exam> examList = (List<Exam>) query.list();
        session.getTransaction().commit();
        return examList;
    }

    //查询考试信息记录数
    public int examCount(Exam s_exam) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        StringBuffer sql = new StringBuffer("select count(*) from t_exam t1 ,t_student t2 where t1.studentId=t2.id ");
        if (s_exam.getStudent() != null && StringUtil.isNotEmpty(s_exam.getStudent().getId())) {
            sql.append(" and t2.id like '%" + s_exam.getStudent().getId() + "%'");
        }
        if (s_exam.getStudent() != null && StringUtil.isNotEmpty(s_exam.getStudent().getName())) {
            sql.append(" and t2.name like '%" + s_exam.getStudent().getName() + "%'");
        }
        Query query = session.createSQLQuery(sql.toString());
        int count = ((BigInteger) query.uniqueResult()).intValue();
        session.getTransaction().commit();
        return count;
    }
}

ManagerDao

package com.java.yzl.dao;

import com.java.yzl.bean.Manager;
import com.java.yzl.daoInter.ManagerDaoInter;
import com.java.yzl.util.HibernateUtil;
import org.hibernate.Query;
import org.hibernate.Session;


public class ManagerDao implements ManagerDaoInter {

    //管理员登录验证
    public Manager login(Manager manager) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Query query = session.createQuery("from Manager as m where m.userName=:userName and m.password=:password ");
        query.setString("userName", manager.getUserName());
        query.setString("password", manager.getPassword());
        Manager resultManager = (Manager) query.uniqueResult();
        session.getTransaction().commit();
        return resultManager;
    }
}

PaperDao

package com.java.yzl.dao;

import com.java.yzl.bean.Paper;
import com.java.yzl.daoInter.PaperDaoInter;
import com.java.yzl.util.HibernateUtil;
import org.hibernate.Query;
import org.hibernate.Session;

import java.util.List;


public class PaperDao implements PaperDaoInter {

    //获取所有试卷
    public List<Paper> getPapers() throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Query query = session.createQuery("from Paper");
        @SuppressWarnings("unchecked")
        List<Paper> paperList = (List<Paper>) query.list();
        session.getTransaction().commit();
        return paperList;
    }

    //获取指定试卷
    public Paper getPaper(String paperId) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Paper paper = (Paper) session.get(Paper.class, Integer.parseInt(paperId));
        session.getTransaction().commit();
        return paper;
    }

    //保存试卷实体
    public void savePaper(Paper paper) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.merge(paper);
        session.getTransaction().commit();
    }

    //删除试卷
    public void paperDelete(Paper paper) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.delete(paper);
        session.getTransaction().commit();
    }
}

QuestionDao

package com.java.yzl.dao;
//问题DAO类

import com.java.yzl.bean.PageBean;
import com.java.yzl.bean.Question;
import com.java.yzl.bean.Student;
import com.java.yzl.daoInter.QuestionDaoInter;
import com.java.yzl.util.HibernateUtil;
import com.java.yzl.util.StringUtil;
import org.hibernate.Query;
import org.hibernate.Session;

import java.math.BigInteger;
import java.util.List;


public class QuestionDao implements QuestionDaoInter {

    //通过问题id获取问题实体
    public Question getQuestion(String questionId) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Question question = (Question) session.get(Question.class, Integer.parseInt(questionId));
        session.getTransaction().commit();
        return question;
    }

    //判断执行的试卷下有无题目
    public boolean existQuestionByPaperId(String paperId) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Query query = session.createQuery("from Question as q where q.paper.id=:paperId");
        query.setString("paperId", paperId);
        @SuppressWarnings("unchecked")
        List<Student> studentList = (List<Student>) query.list();
        session.getTransaction().commit();
        if (studentList.size() > 0) {
            return true;
        } else {
            return false;
        }
    }

    //获取所有题目
    public List<Question> getQuestions(Question s_question, PageBean pageBean) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        StringBuffer hql = new StringBuffer("from Question");
        if (StringUtil.isNotEmpty(s_question.getSubject())) {
            hql.append(" and subject like '%" + s_question.getSubject() + "%'");
        }
        Query query = session.createQuery(hql.toString().replaceFirst("and", "where"));
        if (pageBean != null) {
            query.setFirstResult(pageBean.getStart());
            query.setMaxResults(pageBean.getPageSize());
        }
        @SuppressWarnings("unchecked")
        List<Question> questionList = (List<Question>) query.list();
        session.getTransaction().commit();
        return questionList;
    }

    //查询试题记录数
    public int questionCount(Question s_question) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        StringBuffer sql = new StringBuffer("select count(*) from t_question");
        if (StringUtil.isNotEmpty(s_question.getSubject())) {
            sql.append(" and subject like '%" + s_question.getSubject() + "%'");
        }
        Query query = session.createSQLQuery(sql.toString().replaceFirst("and", "where"));
        int count = ((BigInteger) query.uniqueResult()).intValue();
        session.getTransaction().commit();
        return count;
    }

    //保存试题实体
    public void saveQuestion(Question question) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.merge(question);
        session.getTransaction().commit();
    }

    //删除试题
    public void deleteQuestion(Question question) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.delete(question);
        session.getTransaction().commit();
    }
}

StudentDao

package com.java.yzl.dao;

import com.java.yzl.bean.PageBean;
import com.java.yzl.bean.Student;
import com.java.yzl.daoInter.StudentDaoInter;
import com.java.yzl.util.HibernateUtil;
import com.java.yzl.util.StringUtil;
import org.hibernate.Query;
import org.hibernate.Session;

import java.math.BigInteger;
import java.util.List;

public class StudentDao implements StudentDaoInter {

    //学生登录
    public Student login(Student student) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Query query = session.createQuery("from Student as s where s.id=:id and s.password=:password ");
        query.setString("id", student.getId());
        query.setString("password", student.getPassword());
        Student resultStu = (Student) query.uniqueResult();
        session.getTransaction().commit();
        return resultStu;
    }

    //通过id获取学生实体
    public Student getStudentById(String id) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Student student = (Student) session.get(Student.class, id);
        session.getTransaction().commit();
        return student;
    }

    //保存学生实体
    public void saveStudent(Student student) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.merge(student);
        session.getTransaction().commit();
    }

    //获取所有学生
    public List<Student> getStudents(Student s_student, PageBean pageBean) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        StringBuffer hql = new StringBuffer("from Student");
        if (StringUtil.isNotEmpty(s_student.getId())) {
            hql.append(" and id like '%" + s_student.getId() + "%'");
        }
        if (StringUtil.isNotEmpty(s_student.getName())) {
            hql.append(" and name like '%" + s_student.getName() + "%'");
        }
        Query query = session.createQuery(hql.toString().replaceFirst("and", "where"));
        if (pageBean != null) {
            query.setFirstResult(pageBean.getStart());
            query.setMaxResults(pageBean.getPageSize());
        }
        @SuppressWarnings("unchecked")
        List<Student> studentList = (List<Student>) query.list();
        session.getTransaction().commit();
        return studentList;
    }

    //查询学生记录数
    public int studentCount(Student s_student) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        StringBuffer sql = new StringBuffer("select count(*) from t_student");
        if (StringUtil.isNotEmpty(s_student.getId())) {
            sql.append(" and id like '%" + s_student.getId() + "%'");
        }
        if (StringUtil.isNotEmpty(s_student.getName())) {
            sql.append(" and name like '%" + s_student.getName() + "%'");
        }
        Query query = session.createSQLQuery(sql.toString().replaceFirst("and", "where"));
        int count = ((BigInteger) query.uniqueResult()).intValue();
        session.getTransaction().commit();
        return count;
    }

    //保存学生
    public void studentSave(Student student) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.merge(student);
        session.getTransaction().commit();
    }

    //删除学生
    public void studentDelete(Student student) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.delete(student);
        session.getTransaction().commit();
    }

    //通过id获取学生
    public Student getStudent(String id) throws Exception {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Student student = (Student) session.get(Student.class, id);
        session.getTransaction().commit();
        return student;
    }
}

login.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>在线考试(考生登录端)</title>
    <link href="${pageContext.request.contextPath}/style/studentInfo.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/bootstrap/js/jQuery.js"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript">
        if ('${error}' != '') {
            alert('${error}');
        }
    </script>

    <script type="text/javascript">
        function checkForm() {
            var id = document.getElementById("id").value;
            var password = document.getElementById("password").value;
            if (id == null || id == "") {
                alert("准考证号不能为空!");
                return false;
            }
            if (password == null || password == "") {
                alert("登录密码不能为空!");
                return false;
            }
            return true;
        }

        function resetValue() {
            document.getElementById("id").value = "";
            document.getElementById("password").value = "";
        }
    </script>
</head>
<body>
<div align="center" style="padding-top: 20px;">
    <form action="student!login" method="post" onsubmit="return checkForm()">
        <table width="1004" height="584" background="image/login.jpg">
            <tr height="200">
                <td colspan="4"></td>
            </tr>
            <tr height="10">
                <td width="68%"></td>
                <td width="10%"><label>准考证号:</label></td>
                <td><input type="text" id="id" name="student.id" value="${student.id }"/></td>
                <td width="30%"></td>
            </tr>
            <tr height="10">
                <td width="40%"></td>
                <td width="10%"><label>登录密码:</label></td>
                <td><input type="password" id="password" name="student.password" value="${student.password }"/></td>
                <td width="30%"></td>
            </tr>
            <tr height="10">
                <td width="40%"></td>
                <td width="10%">
                    <button class="btn btn-primary" type="submit">登录</button>
                </td>
                <td>
                    <button class="btn btn-primary" type="button" onclick="resetValue()">重置</button>
                </td>
                <td><a href="login-admin.jsp" class="btn btn-primary">后台管理</a></td>
                <td width="30%"></td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>

menu.jsp

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script type="text/javascript">
	function logout(){
		if(confirm('您确定要退出系统吗?')){
			window.location.href='student!logout';
		}
	}
	function logout2(){
		if(confirm('您确定要退出系统吗?')){
			window.location.href='manager!logout';
		}
	}
	
</script>
<div class="navbar">
  <div class="navbar-inner">
    <a class="brand" href="main.jsp">首页</a>
    <ul class="nav">
    	<c:choose>
    		<c:when test="${currentUser.flag==1}">
    			<li><a href="${pageContext.request.contextPath}/student!list">考生信息管理</a></li>
    			<li><a href="${pageContext.request.contextPath}/exam!examList">考生成绩查询</a></li>
    			<li><a href="${pageContext.request.contextPath}/paper!paperList">试卷管理</a></li>
    			<li><a href="${pageContext.request.contextPath}/question!list">题目管理</a></li>
    			<li><a href="javascript:logout2()">退出系统</a></li>
    		</c:when>
    		<c:otherwise>
		    	<li><a href="${pageContext.request.contextPath}/paper!list">在线考试</a></li>
		    	<li><a href="${pageContext.request.contextPath}/exam!getExams?s_exam.student.id=${currentUser.id}">成绩查询</a></li>
		    	<li><a href="${pageContext.request.contextPath}/student!preUpdatePassword">修改密码</a></li>
		    	<li><a href="javascript:logout()">退出系统</a></li>
    		</c:otherwise>
    	</c:choose>
    </ul>
  </div>
</div>

head.jsp

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<div align="center">
	<div style="background: url('${pageContext.request.contextPath}/image/banner.jpg');
				height:90px;width:1000px;float:right;" >
		<font style="float: right;padding: 65px 20px 20px 10px;">欢迎:<strong>${currentUser.name }</strong></font>
	</div>
</div>
				

foot.jsp

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<div align="center">
		<div class="foot">Copyright ? 2021-2021 无民科技</div>
</div>

default.jsp

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<div class="defaultPage">
	<p>欢迎使用在线考试系统!</p>
</div>

四、其他

1.其他系统实现

1.JavaWeb系统系列实现

Java+JSP实现学生图书管理系统

Java+JSP实现学生信息管理系统

Java+JSP实现用户信息管理系统

Java+Servlet+JSP实现航空订票系统

Java+Servlet+JSP实现学生选课管理系统

Java+Servlet+JSP实现宠物诊所管理系统

Java+Servlet+JSP实现学生成绩管理系统-1

Java+Servlet+JSP实现学生成绩管理系统-2

Java+SSM+Easyui实现网上考试系统

Java+Springboot+Mybatis+Bootstrap+Maven实现网上商城系统

2.JavaSwing系统系列实现

Java+Swing实现斗地主游戏

Java+Swing实现图书管理系统

Java+Swing实现医院管理系统

Java+Swing实现仓库管理系统-1

Java+Swing实现仓库管理系统-2

Java+Swing实现考试管理系统

Java+Swing实现通讯录管理系统

Java+Swing实现停车场管理系统

Java+Swing实现学生信息管理系统

Java+Swing实现学生宿舍管理系统

Java+Swing实现学生选课管理系统

Java+Swing实现学生成绩管理系统

Java+Swing实现学校教材管理系统

Java+Swing实现学校教务管理系统

Java+Swing实现企业人事管理系统

Java+Swing实现电子相册管理系统

Java+Swing实现超市管理系统-TXT存储数据

Java+Swing实现自助取款机系统-TXT存储数据

Java+Swing实现宠物商店管理系统-TXT存储数据

2.获取源码

点击以下链接获取源码,数据库文件在sql文件夹下面。论文在论文文件夹下面。

Java+SSH+Bootstrap+Mysql在线考试系统源码

3.运行项目

请点击以下链接,部署你的项目。

IDEA如何导入JavaWeb项目超详细视频教程

4.备注

如有侵权请联系我删除。

5.支持博主

如果您觉得此文对您有帮助,请点赞加关注。祝您生活愉快!想要获取其他资源可关注左侧微信公众号获取!

6.鸡汤

心怀大我,成就自我!

  Java知识库 最新文章
计算距离春节还有多长时间
系统开发系列 之WebService(spring框架+ma
springBoot+Cache(自定义有效时间配置)
SpringBoot整合mybatis实现增删改查、分页查
spring教程
SpringBoot+Vue实现美食交流网站的设计与实
虚拟机内存结构以及虚拟机中销毁和新建对象
SpringMVC---原理
小李同学: Java如何按多个字段分组
打印票据--java
上一篇文章      下一篇文章      查看所有文章
加:2021-07-14 10:44:42  更:2021-07-14 10:44:55 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/17 20:43:57-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码