基于javaweb+mysql的jsp+servlet毕业生离校管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)

该系统使用JavaWeb技术,结合Servlet、JSP和MySQL数据库,实现了用户登录注册、图形验证码生成、用户信息、公告信息以及学生信息的增删改查功能,支持分页和编码过滤。涉及MVC模式和Session管理。
摘要由CSDN通过智能技术生成

基于javaweb+mysql的jsp+servlet毕业生离校管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

技术框架

JavaBean MVC JSP Servlet MySQL CSS JavaScript Bootstrap Ajax

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

登录、注册、退出、用户模块、公告模块、学生信息模块的增删改查管理

eclipse/MyEclipse运行:

idea运行:

            //  这三条语句都可以关闭浏览器的缓冲区,但是由于浏览器的版本不同,对这三条语句的支持也不同
            //  因此,为了保险起见,建议同时使用这三条语句来关闭浏览器的缓冲区
            response.setHeader("ragma", "No-cache");
            response.setHeader("Cache-Control", "no-cache");
            response.setDateHeader("Expires", 0);
            //  设置图形验证码的长和宽(图形的大小)
            int width = 90, height = 20;
            BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
            Graphics g = image.getGraphics();//  获得用于输出文字的Graphics对象
            Random random = new Random();
            g.setColor(getRandomColor(180, 250));// 随机设置要填充的颜色
            g.fillRect(0, 0, width, height);//  填充图形背景
            //  设置初始字体
            g.setFont(new Font("Times New Roman", Font.ITALIC, height));
            g.setColor(getRandomColor(120, 180));// 随机设置字体颜色
            //  用于保存最后随机生成的验证码
            StringBuilder validationCode = new StringBuilder();
            //  验证码的随机字体
            String[] fontNames = {"Times New Roman", "Book antiqua", "Arial"};
            for (int i = 0; i < 4; i++) {
                //  随机设置当前验证码的字符的字体
                g.setFont(new Font(fontNames[random.nextInt(3)], Font.ITALIC, height));
                //  随机获得当前验证码的字符
                char codeChar = codeChars.charAt(random.nextInt(charsLength));
                validationCode.append(codeChar);
                //  随机设置当前验证码字符的颜色
                g.setColor(getRandomColor(10, 100));
                //  在图形上输出验证码字符,x和y都是随机生成的
                g.drawString(String.valueOf(codeChar), 16 * i + random.nextInt(7), height - random.nextInt(6));
            }
            HttpSession session = request.getSession();
            session.setMaxInactiveInterval(5 * 60);
            //  将验证码保存在session对象中,key为validation_code
            session.setAttribute("validationCode", validationCode.toString());
            g.dispose();//  关闭Graphics对象
            OutputStream os = response.getOutputStream();
            ImageIO.write(image, "JPEG", os);// 以JPEG格式向客户端发送图形验证码
        } else if ("resetPassword".equalsIgnoreCase(action)) {
            String msg;
            User loginUser = (User) request.getSession().getAttribute("loginUser");
            String oldPassword = request.getParameter("oldPassword");
            if (!loginUser.getPassword().equals(oldPassword)) {
                msg = "原密码错误!";
            //调用Service层删除方法(delete),将对应的记录删除
            studentService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到Student对象的属性里
            Student vo = new Student();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setStudentName(request.getParameter("studentName"));
            vo.setStudentAge(request.getParameter("studentAge"));
            vo.setStudentSex(request.getParameter("studentSex"));
            vo.setStudentNumber(request.getParameter("studentNumber"));
            vo.setStudentClass(request.getParameter("studentClass"));
            vo.setStudentPhone(request.getParameter("studentPhone"));
            vo.setStudentStatus(request.getParameter("studentStatus"));
            vo.setStudentDate(request.getParameter("studentDate"));
            vo.setStudentText(request.getParameter("studentText"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层更新方法(update),更新记录
            studentService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            StudentService studentService = new StudentServiceImpl();
            Student vo = studentService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);//Get请求和Post请求的处理是一样的,所以把request、response转交给Post方法就好
    }

    /**
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //过滤编码
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            Student vo = new Student();
            //取出页面传进来的各个数据,并设置到Student对象的属性里
            vo.setStudentName(request.getParameter("studentName"));
            vo.setStudentAge(request.getParameter("studentAge"));
            vo.setStudentSex(request.getParameter("studentSex"));
            vo.setStudentNumber(request.getParameter("studentNumber"));
            vo.setStudentClass(request.getParameter("studentClass"));
            vo.setStudentPhone(request.getParameter("studentPhone"));
            vo.setStudentStatus(request.getParameter("studentStatus"));
            vo.setStudentDate(request.getParameter("studentDate"));
            vo.setStudentText(request.getParameter("studentText"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层增加方法(add),增加记录
            studentService.add(vo);
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的学生信息记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            studentService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到Student对象的属性里
            Student vo = new Student();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setStudentName(request.getParameter("studentName"));
            vo.setStudentAge(request.getParameter("studentAge"));
            vo.setStudentSex(request.getParameter("studentSex"));
            vo.setStudentNumber(request.getParameter("studentNumber"));
            vo.setStudentClass(request.getParameter("studentClass"));
            vo.setStudentPhone(request.getParameter("studentPhone"));
            vo.setStudentStatus(request.getParameter("studentStatus"));
            vo.setStudentDate(request.getParameter("studentDate"));
            vo.setStudentText(request.getParameter("studentText"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层更新方法(update),更新记录
            studentService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //过滤编码
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            Notice vo = new Notice();
            //取出页面传进来的各个数据,并设置到Notice对象的属性里
            vo.setNoticeName(request.getParameter("noticeName"));
            vo.setNoticeText(request.getParameter("noticeText"));
            vo.setNoticeType(request.getParameter("noticeType"));
            vo.setCreateDate(request.getParameter("createDate"));
            NoticeService noticeService = new NoticeServiceImpl();
            //调用Service层增加方法(add),增加记录
            noticeService.add(vo);
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的公告记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            NoticeService noticeService = new NoticeServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            noticeService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到Notice对象的属性里
            Notice vo = new Notice();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setNoticeName(request.getParameter("noticeName"));
            vo.setNoticeText(request.getParameter("noticeText"));
            vo.setNoticeType(request.getParameter("noticeType"));
            vo.setCreateDate(request.getParameter("createDate"));
            NoticeService noticeService = new NoticeServiceImpl();
            //调用Service层更新方法(update),更新记录
            noticeService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            NoticeService noticeService = new NoticeServiceImpl();
            Notice vo = noticeService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
        }
    }

    /**
        request.getSession().setAttribute("pageBean", pb);
        request.getSession().setAttribute("list", pb.getList());

        response.sendRedirect("user_list.jsp");
    }
}
package com.demo.servlet;

/**
 * 公告模块的Servlet控制层,负责接收页面传过来的请求参数,根据action参数的值来确定页面要执行的具体操作<br>
 * 而后再调用NoticeService业务层的方法来处理具体的业务,最后将处理完成的结果返回或跳转至相应页面
 */
//@WebServlet("/NoticeServlet")
public class NoticeServlet extends HttpServlet {

    /**
     * 处理Post请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //过滤编码
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            Notice vo = new Notice();
            //取出页面传进来的各个数据,并设置到Notice对象的属性里
            vo.setNoticeName(request.getParameter("noticeName"));
            vo.setNoticeText(request.getParameter("noticeText"));
            vo.setNoticeType(request.getParameter("noticeType"));
            vo.setCreateDate(request.getParameter("createDate"));
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            NoticeService noticeService = new NoticeServiceImpl();
            Notice vo = noticeService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);//Get请求和Post请求的处理是一样的,所以把request、response转交给Post方法就好
    }

    /**
     * 根据参数,查询出条例条件的记录集合,最后将数据返回给调用处或者将数据集合设置到session域里,再跳转到对应的列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = request.getParameter("searchColumn");
        String keyword = request.getParameter("keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        NoticeService noticeService = new NoticeServiceImpl();
        Map<String, Object> map = noticeService.list(params);
        request.getSession().setAttribute("list", map.get("list"));

        Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
        String pageNum = request.getParameter("pageNum");//封装分页参数
        com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
        params.put("startIndex", pb.getStartIndex());
        params.put("pageSize", pb.getPageSize());
        List list = (List) noticeService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
        pb.setServlet("NoticeServlet");
        pb.setSearchColumn(searchColumn);
        pb.setKeyword(keyword);
        pb.setList(list);
        request.getSession().setAttribute("pageBean", pb);
        request.getSession().setAttribute("list", pb.getList());

            g.dispose();//  关闭Graphics对象
            OutputStream os = response.getOutputStream();
            ImageIO.write(image, "JPEG", os);// 以JPEG格式向客户端发送图形验证码
        } else if ("resetPassword".equalsIgnoreCase(action)) {
            String msg;
            User loginUser = (User) request.getSession().getAttribute("loginUser");
            String oldPassword = request.getParameter("oldPassword");
            if (!loginUser.getPassword().equals(oldPassword)) {
                msg = "原密码错误!";
            } else {
                String newPassword = request.getParameter("newPassword");
                loginUser.setPassword(newPassword);
                UserService userService = new UserServiceImpl();
                userService.update(loginUser);
                msg = "修改成功!";
            }
            request.getSession().setAttribute("alert_msg", msg);
            request.getRequestDispatcher("reset_password.jsp").forward(request, response);
        } else {
            response.sendRedirect("login.jsp");
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    // 返回一个随机颜色(Color对象)
    private Color getRandomColor(int minColor, int maxColor) {
        Random random = new Random();
        // 保存minColor最大不会超过255
        if (minColor > 255)
            minColor = 255;
        //  保存minColor最大不会超过255
        if (maxColor > 255)

    // 返回一个随机颜色(Color对象)
    private Color getRandomColor(int minColor, int maxColor) {
        Random random = new Random();
        // 保存minColor最大不会超过255
        if (minColor > 255)
            minColor = 255;
        //  保存minColor最大不会超过255
        if (maxColor > 255)
            maxColor = 255;
        //  获得红色的随机颜色值
        int red = minColor + random.nextInt(maxColor - minColor);
        //  获得绿色的随机颜色值
        int green = minColor + random.nextInt(maxColor - minColor);
        //  获得蓝色的随机颜色值
        int blue = minColor + random.nextInt(maxColor - minColor);
        return new Color(red, green, blue);
    }
}
package com.demo.servlet;

/**
 * 学生信息模块的Servlet控制层,负责接收页面传过来的请求参数,根据action参数的值来确定页面要执行的具体操作<br>
 * 而后再调用StudentService业务层的方法来处理具体的业务,最后将处理完成的结果返回或跳转至相应页面
 */
//@WebServlet("/StudentServlet")
public class StudentServlet extends HttpServlet {

    /**
     * 处理Post请求
     *
     * @param request

    /**
     * 处理Post请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //过滤编码
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            User vo = new User();
            //取出页面传进来的各个数据,并设置到User对象的属性里
            vo.setUsername(request.getParameter("username"));
            vo.setPassword(request.getParameter("password"));
            vo.setRealName(request.getParameter("realName"));
            vo.setUserSex(request.getParameter("userSex"));
            vo.setUserPhone(request.getParameter("userPhone"));
            vo.setUserText(request.getParameter("userText"));
            vo.setUserType(request.getParameter("userType"));
            UserService userService = new UserServiceImpl();
            //调用Service层增加方法(add),增加记录
            userService.add(vo);
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的用户记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            UserService userService = new UserServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            userService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到User对象的属性里
            User vo = new User();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setUsername(request.getParameter("username"));
            vo.setPassword(request.getParameter("password"));
            vo.setRealName(request.getParameter("realName"));
            vo.setUserSex(request.getParameter("userSex"));
            vo.setUserPhone(request.getParameter("userPhone"));
            vo.setUserText(request.getParameter("userText"));

/**
 * 学生信息模块的Servlet控制层,负责接收页面传过来的请求参数,根据action参数的值来确定页面要执行的具体操作<br>
 * 而后再调用StudentService业务层的方法来处理具体的业务,最后将处理完成的结果返回或跳转至相应页面
 */
//@WebServlet("/StudentServlet")
public class StudentServlet extends HttpServlet {

    /**
     * 处理Post请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //过滤编码
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            Student vo = new Student();
            //取出页面传进来的各个数据,并设置到Student对象的属性里
            vo.setStudentName(request.getParameter("studentName"));
            vo.setStudentAge(request.getParameter("studentAge"));
            vo.setStudentSex(request.getParameter("studentSex"));
            vo.setStudentNumber(request.getParameter("studentNumber"));
            vo.setStudentClass(request.getParameter("studentClass"));
            vo.setStudentPhone(request.getParameter("studentPhone"));
            vo.setStudentStatus(request.getParameter("studentStatus"));
            vo.setStudentDate(request.getParameter("studentDate"));
            vo.setStudentText(request.getParameter("studentText"));
            StudentService studentService = new StudentServiceImpl();
            HttpSession session = request.getSession();
            session.setMaxInactiveInterval(5 * 60);
            //  将验证码保存在session对象中,key为validation_code
            session.setAttribute("validationCode", validationCode.toString());
            g.dispose();//  关闭Graphics对象
            OutputStream os = response.getOutputStream();
            ImageIO.write(image, "JPEG", os);// 以JPEG格式向客户端发送图形验证码
        } else if ("resetPassword".equalsIgnoreCase(action)) {
            String msg;
            User loginUser = (User) request.getSession().getAttribute("loginUser");
            String oldPassword = request.getParameter("oldPassword");
            if (!loginUser.getPassword().equals(oldPassword)) {
                msg = "原密码错误!";
            } else {
                String newPassword = request.getParameter("newPassword");
                loginUser.setPassword(newPassword);
                UserService userService = new UserServiceImpl();
                userService.update(loginUser);
                msg = "修改成功!";
            }
            request.getSession().setAttribute("alert_msg", msg);
            request.getRequestDispatcher("reset_password.jsp").forward(request, response);
        } else {
            response.sendRedirect("login.jsp");
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    // 返回一个随机颜色(Color对象)
    private Color getRandomColor(int minColor, int maxColor) {
        Random random = new Random();
        // 保存minColor最大不会超过255
        if (minColor > 255)
            minColor = 255;
        //  保存minColor最大不会超过255
        if (maxColor > 255)
            maxColor = 255;
        //  获得红色的随机颜色值
        int red = minColor + random.nextInt(maxColor - minColor);

/**
 * 用户模块的Servlet控制层,负责接收页面传过来的请求参数,根据action参数的值来确定页面要执行的具体操作<br>
 * 而后再调用UserService业务层的方法来处理具体的业务,最后将处理完成的结果返回或跳转至相应页面
 */
//@WebServlet("/UserServlet")
public class UserServlet extends HttpServlet {

    /**
     * 处理Post请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //过滤编码
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            User vo = new User();
            //取出页面传进来的各个数据,并设置到User对象的属性里
            vo.setUsername(request.getParameter("username"));
            vo.setPassword(request.getParameter("password"));
            vo.setRealName(request.getParameter("realName"));
            vo.setUserSex(request.getParameter("userSex"));
            vo.setUserPhone(request.getParameter("userPhone"));
            vo.setUserText(request.getParameter("userText"));
            vo.setUserType(request.getParameter("userType"));
            UserService userService = new UserServiceImpl();
            //调用Service层增加方法(add),增加记录
            userService.add(vo);
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的用户记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            UserService userService = new UserServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            userService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到User对象的属性里
            User vo = new User();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setUsername(request.getParameter("username"));
            vo.setPassword(request.getParameter("password"));
            vo.setRealName(request.getParameter("realName"));
            vo.setUserSex(request.getParameter("userSex"));
            vo.setUserPhone(request.getParameter("userPhone"));
            vo.setUserText(request.getParameter("userText"));
    }
}
package com.demo.servlet;

/**
 * 公告模块的Servlet控制层,负责接收页面传过来的请求参数,根据action参数的值来确定页面要执行的具体操作<br>
 * 而后再调用NoticeService业务层的方法来处理具体的业务,最后将处理完成的结果返回或跳转至相应页面
 */
//@WebServlet("/NoticeServlet")
public class NoticeServlet extends HttpServlet {

    /**
     * 处理Post请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //过滤编码
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            Notice vo = new Notice();
            //取出页面传进来的各个数据,并设置到Notice对象的属性里
            vo.setNoticeName(request.getParameter("noticeName"));
            vo.setNoticeText(request.getParameter("noticeText"));
            vo.setNoticeType(request.getParameter("noticeType"));
            vo.setCreateDate(request.getParameter("createDate"));

/**
 * 学生信息模块的Servlet控制层,负责接收页面传过来的请求参数,根据action参数的值来确定页面要执行的具体操作<br>
 * 而后再调用StudentService业务层的方法来处理具体的业务,最后将处理完成的结果返回或跳转至相应页面
 */
//@WebServlet("/StudentServlet")
public class StudentServlet extends HttpServlet {

    /**
     * 处理Post请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //过滤编码
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            Student vo = new Student();
            //取出页面传进来的各个数据,并设置到Student对象的属性里
            vo.setStudentName(request.getParameter("studentName"));
            vo.setStudentAge(request.getParameter("studentAge"));
            vo.setStudentSex(request.getParameter("studentSex"));
            vo.setStudentNumber(request.getParameter("studentNumber"));
            vo.setStudentClass(request.getParameter("studentClass"));
            vo.setStudentPhone(request.getParameter("studentPhone"));
            vo.setStudentStatus(request.getParameter("studentStatus"));
            vo.setStudentDate(request.getParameter("studentDate"));
            vo.setStudentText(request.getParameter("studentText"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层增加方法(add),增加记录
            studentService.add(vo);
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的学生信息记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的用户记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            UserService userService = new UserServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            userService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到User对象的属性里
            User vo = new User();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setUsername(request.getParameter("username"));
            vo.setPassword(request.getParameter("password"));
            vo.setRealName(request.getParameter("realName"));
            vo.setUserSex(request.getParameter("userSex"));
            vo.setUserPhone(request.getParameter("userPhone"));
            vo.setUserText(request.getParameter("userText"));
            vo.setUserType(request.getParameter("userType"));
            UserService userService = new UserServiceImpl();
            //调用Service层更新方法(update),更新记录
            userService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            UserService userService = new UserServiceImpl();
            User vo = userService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);//Get请求和Post请求的处理是一样的,所以把request、response转交给Post方法就好
    }
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            NoticeService noticeService = new NoticeServiceImpl();
            Notice vo = noticeService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);//Get请求和Post请求的处理是一样的,所以把request、response转交给Post方法就好
    }

    /**
     * 根据参数,查询出条例条件的记录集合,最后将数据返回给调用处或者将数据集合设置到session域里,再跳转到对应的列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = request.getParameter("searchColumn");
        String keyword = request.getParameter("keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        NoticeService noticeService = new NoticeServiceImpl();
        Map<String, Object> map = noticeService.list(params);
        request.getSession().setAttribute("list", map.get("list"));

        Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
        String pageNum = request.getParameter("pageNum");//封装分页参数
        com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
        params.put("startIndex", pb.getStartIndex());
        params.put("pageSize", pb.getPageSize());
        List list = (List) noticeService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
        Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
        String pageNum = request.getParameter("pageNum");//封装分页参数
        com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
        params.put("startIndex", pb.getStartIndex());
        params.put("pageSize", pb.getPageSize());
        List list = (List) noticeService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
        pb.setServlet("NoticeServlet");
        pb.setSearchColumn(searchColumn);
        pb.setKeyword(keyword);
        pb.setList(list);
        request.getSession().setAttribute("pageBean", pb);
        request.getSession().setAttribute("list", pb.getList());

        response.sendRedirect("notice_list.jsp");
    }
}
package com.demo.util;

/**
 * 这是过滤器
 * 主要负责过滤编码为utf-8及登录拦截,禁止未登录就访问
 */
public class LoginFilter implements Filter {

    //@Override
    public void destroy() {
    }

    //@Override
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;
        HttpSession session = request.getSession();
        //过滤编码
        request.setCharacterEncoding("UTF-8");
            userService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            UserService userService = new UserServiceImpl();
            User vo = userService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);//Get请求和Post请求的处理是一样的,所以把request、response转交给Post方法就好
    }

    /**
     * 根据参数,查询出条例条件的记录集合,最后将数据返回给调用处或者将数据集合设置到session域里,再跳转到对应的列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = request.getParameter("searchColumn");
        String keyword = request.getParameter("keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        UserService userService = new UserServiceImpl();
        Map<String, Object> map = userService.list(params);
        request.getSession().setAttribute("list", map.get("list"));

        Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
        String pageNum = request.getParameter("pageNum");//封装分页参数
        com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
        params.put("startIndex", pb.getStartIndex());
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的用户记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            UserService userService = new UserServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            userService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到User对象的属性里
            User vo = new User();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setUsername(request.getParameter("username"));
            vo.setPassword(request.getParameter("password"));
            vo.setRealName(request.getParameter("realName"));
            vo.setUserSex(request.getParameter("userSex"));
            vo.setUserPhone(request.getParameter("userPhone"));
            vo.setUserText(request.getParameter("userText"));
            vo.setUserType(request.getParameter("userType"));
            UserService userService = new UserServiceImpl();
            //调用Service层更新方法(update),更新记录
            userService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            UserService userService = new UserServiceImpl();
            User vo = userService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);//Get请求和Post请求的处理是一样的,所以把request、response转交给Post方法就好
    }

    /**
     * 根据参数,查询出条例条件的记录集合,最后将数据返回给调用处或者将数据集合设置到session域里,再跳转到对应的列表页面
     *
     * @param request
            NoticeService noticeService = new NoticeServiceImpl();
            //调用Service层更新方法(update),更新记录
            noticeService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            NoticeService noticeService = new NoticeServiceImpl();
            Notice vo = noticeService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);//Get请求和Post请求的处理是一样的,所以把request、response转交给Post方法就好
    }

    /**
     * 根据参数,查询出条例条件的记录集合,最后将数据返回给调用处或者将数据集合设置到session域里,再跳转到对应的列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = request.getParameter("searchColumn");
        String keyword = request.getParameter("keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        NoticeService noticeService = new NoticeServiceImpl();
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            Student vo = new Student();
            //取出页面传进来的各个数据,并设置到Student对象的属性里
            vo.setStudentName(request.getParameter("studentName"));
            vo.setStudentAge(request.getParameter("studentAge"));
            vo.setStudentSex(request.getParameter("studentSex"));
            vo.setStudentNumber(request.getParameter("studentNumber"));
            vo.setStudentClass(request.getParameter("studentClass"));
            vo.setStudentPhone(request.getParameter("studentPhone"));
            vo.setStudentStatus(request.getParameter("studentStatus"));
            vo.setStudentDate(request.getParameter("studentDate"));
            vo.setStudentText(request.getParameter("studentText"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层增加方法(add),增加记录
            studentService.add(vo);
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的学生信息记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            studentService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到Student对象的属性里
            Student vo = new Student();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setStudentName(request.getParameter("studentName"));
            vo.setStudentAge(request.getParameter("studentAge"));
            vo.setStudentSex(request.getParameter("studentSex"));
            vo.setStudentNumber(request.getParameter("studentNumber"));
            vo.setStudentClass(request.getParameter("studentClass"));
            vo.setStudentPhone(request.getParameter("studentPhone"));
            vo.setStudentStatus(request.getParameter("studentStatus"));
            vo.setStudentDate(request.getParameter("studentDate"));
            vo.setStudentText(request.getParameter("studentText"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层更新方法(update),更新记录
            studentService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            StudentService studentService = new StudentServiceImpl();
            Student vo = studentService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    // 返回一个随机颜色(Color对象)
    private Color getRandomColor(int minColor, int maxColor) {
        Random random = new Random();
        // 保存minColor最大不会超过255
        if (minColor > 255)
            minColor = 255;
        //  保存minColor最大不会超过255
        if (maxColor > 255)
            maxColor = 255;
        //  获得红色的随机颜色值
        int red = minColor + random.nextInt(maxColor - minColor);
        //  获得绿色的随机颜色值
        int green = minColor + random.nextInt(maxColor - minColor);
        //  获得蓝色的随机颜色值
        int blue = minColor + random.nextInt(maxColor - minColor);
        return new Color(red, green, blue);
    }
}
package com.demo.servlet;

/**
 * 学生信息模块的Servlet控制层,负责接收页面传过来的请求参数,根据action参数的值来确定页面要执行的具体操作<br>
 * 而后再调用StudentService业务层的方法来处理具体的业务,最后将处理完成的结果返回或跳转至相应页面
 */
//@WebServlet("/StudentServlet")
            //调用Service层增加方法(add),增加记录
            studentService.add(vo);
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的学生信息记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            studentService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到Student对象的属性里
            Student vo = new Student();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setStudentName(request.getParameter("studentName"));
            vo.setStudentAge(request.getParameter("studentAge"));
            vo.setStudentSex(request.getParameter("studentSex"));
            vo.setStudentNumber(request.getParameter("studentNumber"));
            vo.setStudentClass(request.getParameter("studentClass"));
            vo.setStudentPhone(request.getParameter("studentPhone"));
            vo.setStudentStatus(request.getParameter("studentStatus"));
            vo.setStudentDate(request.getParameter("studentDate"));
            vo.setStudentText(request.getParameter("studentText"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层更新方法(update),更新记录
            studentService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            StudentService studentService = new StudentServiceImpl();
            Student vo = studentService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
            vo.setStudentPhone(request.getParameter("studentPhone"));
            vo.setStudentStatus(request.getParameter("studentStatus"));
            vo.setStudentDate(request.getParameter("studentDate"));
            vo.setStudentText(request.getParameter("studentText"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层增加方法(add),增加记录
            studentService.add(vo);
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的学生信息记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            studentService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到Student对象的属性里
            Student vo = new Student();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setStudentName(request.getParameter("studentName"));
            vo.setStudentAge(request.getParameter("studentAge"));
            vo.setStudentSex(request.getParameter("studentSex"));
            vo.setStudentNumber(request.getParameter("studentNumber"));
            vo.setStudentClass(request.getParameter("studentClass"));
            vo.setStudentPhone(request.getParameter("studentPhone"));
            vo.setStudentStatus(request.getParameter("studentStatus"));
            vo.setStudentDate(request.getParameter("studentDate"));
            vo.setStudentText(request.getParameter("studentText"));
            StudentService studentService = new StudentServiceImpl();
            //调用Service层更新方法(update),更新记录
            studentService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            StudentService studentService = new StudentServiceImpl();
            Student vo = studentService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
            this.redirectList(request, response);
        }
    }

    /**
     * 处理Get请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //过滤编码
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            User vo = new User();
            //取出页面传进来的各个数据,并设置到User对象的属性里
            vo.setUsername(request.getParameter("username"));
            vo.setPassword(request.getParameter("password"));
            vo.setRealName(request.getParameter("realName"));
            vo.setUserSex(request.getParameter("userSex"));
            vo.setUserPhone(request.getParameter("userPhone"));
            vo.setUserText(request.getParameter("userText"));
            vo.setUserType(request.getParameter("userType"));
            UserService userService = new UserServiceImpl();
            //调用Service层增加方法(add),增加记录
            userService.add(vo);
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的用户记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            UserService userService = new UserServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            userService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到User对象的属性里
            User vo = new User();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setUsername(request.getParameter("username"));
            vo.setPassword(request.getParameter("password"));
            vo.setRealName(request.getParameter("realName"));
            vo.setUserSex(request.getParameter("userSex"));
            vo.setUserPhone(request.getParameter("userPhone"));
            vo.setUserText(request.getParameter("userText"));
            vo.setUserType(request.getParameter("userType"));
            UserService userService = new UserServiceImpl();
            //调用Service层更新方法(update),更新记录
            userService.update(vo);
            this.redirectList(request, response);
        } else if ("get".equalsIgnoreCase(action) || "editPre".equalsIgnoreCase(action)) {//根据主键ID,查询详情信息并跳转到详情页面或编辑页面
            Serializable id = request.getParameter("id");//取出页面传入的主键,用于查询详情
            UserService userService = new UserServiceImpl();
            User vo = userService.get(id);
            response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
        } else {//默认去列表页面
public class NoticeServlet extends HttpServlet {

    /**
     * 处理Post请求
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //过滤编码
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        String action = request.getParameter("action");
        if ("add".equals(action)) {//增加
            Notice vo = new Notice();
            //取出页面传进来的各个数据,并设置到Notice对象的属性里
            vo.setNoticeName(request.getParameter("noticeName"));
            vo.setNoticeText(request.getParameter("noticeText"));
            vo.setNoticeType(request.getParameter("noticeType"));
            vo.setCreateDate(request.getParameter("createDate"));
            NoticeService noticeService = new NoticeServiceImpl();
            //调用Service层增加方法(add),增加记录
            noticeService.add(vo);
            this.redirectList(request, response);
        } else if ("delete".equals(action)) {//删除
            //取出表要删除的公告记录的主键
            long id = Long.parseLong(request.getParameter("id"));
            NoticeService noticeService = new NoticeServiceImpl();
            //调用Service层删除方法(delete),将对应的记录删除
            noticeService.delete(id);
            this.redirectList(request, response);
        } else if ("edit".equals(action)) {//修改
            //取出页面传进来的各个数据,并设置到Notice对象的属性里
            Notice vo = new Notice();
            vo.setId(Long.valueOf(request.getParameter("id")));
            vo.setNoticeName(request.getParameter("noticeName"));
            vo.setNoticeText(request.getParameter("noticeText"));

请添加图片描述

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

本系统采用了BS架构模式开发,利用JSP编程,MVC结构以及mysql数据库实现,是一款典型的后台管理系统。 该系统主要是针对于毕业生离校的信息进行管理,毕业生离校是一个繁琐的工作,牵扯到很多部门,所以该系统对毕业生离校各种流程进行了一个统一的管理,系统各个功能如下所示: 它可以分为四个大块功能,分别为:大学生离校的申请与批准,图书借阅查询和未归还图书的查询、宿舍钥匙信息的管理、学校欠费信息管理。 下面是每个功能模块的详细介绍: 学生离校申请:学生登陆系统后,可以对离校信息进行申请,如果批准,方可办理其他手续。 图书借阅查询:学生可以通过该模块进行图书借阅信息的查询,看看是否有未归还的图书。 宿舍钥匙查询:宿舍钥匙信息的查询,可以对学生宿舍钥匙归还信息进行查看管理。 欠费信息查询:学生登陆后可以对自己的欠费信息进行查询查看。 教务处: 它可以分为两个大块功能,分别为:离校学生信息的添加和离校学生申请的确认: 离校学生添加模块:教务处人员可以在线登记离校学生的基本信息。并能通过固定的模板利用导入excel方式批量导入离校学生的信息。 离校学生确认模块:教务处的工作人员,对学生离校信息进行确认操作,通过确认操作的学生,才有资格进入下一个环节。 辅导员: 辅导员可以查看离校的情况,也可以对离校学生信息进行确认: 离校情况查看模块:辅导员登录系统后,可以进入系统查看学生的离校信息。 离校学生确认模块:对申请离校的学生进行确认,可以确认离校学生。 图书馆: 图书馆管理员可以进入系统,确定是否有学生有未归还的图书,确定完毕后进行毕业生离校确认,具体功能如下: 图书借阅管理模块:图书馆管理人员进入系统后,查看借阅信息,确认是否有未归还的图书信息。 离校学生确认模块:图书馆工作人员对归还图书的学生进行离校确认。 宿管处: 学生通过了以上管理人员的审核后,进入宿管处的审核: 宿舍钥匙管理模块:宿管处人员查看学生钥匙的归还信息情况,对归还钥匙的学生进行登记。 离校学生确认模块:宿管处人员对归还钥匙的学生,进行离校确认审核,该学生进入下一环节的审核。 财务处: 财务处人员登录系统,查询学生欠费信息和对离校学生信息进行确定: 欠费信息管理模块:财务人员在线登记学生的欠费信息,并能对欠费信息进行管理。 离校学生确认模块:对未欠费的学生信息进行审核确认。 系部办公室: 通过以上种种步骤后,最后系部办公室确认学生的离校情况: 离校情况查看模块:系办公室工作人员,对学生离校情况进行确认,并对离校学生信息进行导出。 离校学生确认模块:系办公室人员通过该模块查询需要系办公室确认的离校学生,并进行离校确认。 管理员: 人员信息管理模块:完成所有参与审批工作人员的登记管理。
本系统采用了BS架构模式开发,利用JSP编程,MVC结构以及mysql数据库实现,是一款典型的后台管理系统。 该系统主要是针对于毕业生离校的信息进行管理,毕业生离校是一个繁琐的工作,牵扯到很多部门,所以该系统对毕业生离校各种流程进行了一个统一的管理,系统各个功能如下所示: 它可以分为四个大块功能,分别为:大学生离校的申请与批准,图书借阅查询和未归还图书的查询、宿舍钥匙信息的管理、学校欠费信息管理。 下面是每个功能模块的详细介绍: 学生离校申请:学生登陆系统后,可以对离校信息进行申请,如果批准,方可办理其他手续。 图书借阅查询:学生可以通过该模块进行图书借阅信息的查询,看看是否有未归还的图书。 宿舍钥匙查询:宿舍钥匙信息的查询,可以对学生宿舍钥匙归还信息进行查看 管理。 欠费信息查询:学生登陆后可以对自己的欠费信息进行查询查看。 教务处: 它可以分为两个大块功能,分别为:离校学生信息的添加和离校学生申请的确认: 离校学生添加模块:教务处人员可以在线登记离校学生的基本信息。并能通过固定的模板利用导入excel方式批量导入离校学生的信息。 离校学生确认模块:教务处的工作人员,对学生离校信息进行确认操作,通过确认操作的学生,才有资格进入下一个环节。 辅导员: 辅导员可以查看离校的情况,也可以对离校学生信息进行确认: 离校情况查看模块:辅导员登录系统后,可以进入系统查看学生的离校信息。 离校学生确认模块:对申请离校的学生进行确认,可以确认离校学生。 图书馆: 图书馆管理员可以进入系统,确定是否有学生有未归还的图书,确定完毕后进行毕业生离校确认,具体功能如下: 图书借阅管理模块:图书馆管理人员进入系统后,查看借阅信息,确认是否有未归还的图书信息。 离校学生确认模块:图书馆工作人员对归还图书的学生进行离校确认。 宿管处: 学生通过了以上管理人员的审核后,进入宿管处的审核: 宿舍钥匙管理模块:宿管处人员查看学生钥匙的归还信息情况,对归还钥匙的学生进行登记。 离校学生确认模块:宿管处人员对归还钥匙的学生,进行离校确认审核,该学生进入下一环节的审核。 财务处: 财务处人员登录系统,查询学生欠费信息和对离校学生信息进行确定: 欠费信息管理模块:财务人员在线登记学生的欠费信息,并能对欠费信息进行管理。 离校学生确认模块:对未欠费的学生信息进行审核确认。 系部办公室: 通过以上种种步骤后,最后系部办公室确认学生的离校情况: 离校情况查看模块:系办公室工作人员,对学生离校情况进行确认,并对离校学生信息进行导出。 离校学生确认模块:系办公室人员通过该模块查询需要系办公室确认的离校学生,并进行离校确认。 管理员: 人员信息管理模块:完成所有参与审批工作人员的登记管理。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值