java basic course design -- online student course selection system (HTML+CSS+JavaScript+jsp+mysql) -- final homework

Keywords: Java Javascript MySQL

🍅 Author home page: Li Yangyong  

🍅 Introduction: high quality creator in Java field 🏆, [Li Yangyong] author of public account ✌   Resume template, learning materials, interview question bank [pay attention to me and give it to you]

🍅 Get the source code at the end of the article 🍅

  Near the end of the semester, or graduation project, you are still doing java program, network programming and final homework. Do you think the teacher's homework requirements are big? I don't know what to do with my graduation project? Are there too many web features? No suitable type or system? wait. Here, you want to solve the problem in this column 👇🏻👇🏻👇🏻👇🏻

java project boutique actual case sharing

Web front end final homework web page practice

  Can meet your needs. The original Jsp, SSM, SpringBoot, HTML+CSS+JS page design, web college students' web design homework source code and so on can be solved by reference. Without much to say, take an online student course selection system as an example

 

Introduction to preface:

        Our university was upgraded to an undergraduate university after the merger of three colleges and universities. Weifang art school was merged in a few years ago. Therefore, the level of students is stepped and the training mode is diversified. Therefore, as one of the core work of higher education and teaching, the workload of course selection and course scheduling is bound to increase exponentially. Obviously, the traditional way of course selection and arrangement can not adapt to the current special educational situation of our school. It is urgent to design a campus course selection management system to improve its work efficiency. At present, our university has 22 teaching units, 68 undergraduate majors and nearly 23000 full-time students. The campus course selection management system fully integrates the technology and concept of CRMc2] into the campus information system, so that all teachers and students can take the convenience of the campus management system for scientific research and learning, and well solves the problems of difficult course selection of students and heavy workload of teachers in the past. Compared with the traditional way of course selection, the course selection management system based on Java uses computers instead of manpower to closely connect school managers, teachers and students, so as to achieve the efficient exchange of information. With this course selection system, the school's educational administration managers can make the teaching resources can be allocated and used quickly and reasonably, so as to minimize the waste of resources; Teachers and course selection managers can greatly improve their work efficiency, so that they have more time and energy to focus on their own work; Students ensure timeliness and accuracy in online course selection, so as to avoid the failure and delay of course selection caused by uncertain factors such as repetition and congestion. It fully embodies the advantages of systematic management in this information age.

Main function design:

Operating environment:   java jdk 1.8 and mysql5 are preferred   , Tomcat 7. X, 8. X and 9. X versions are available

Main technologies:   HTML+CSS+JavaScript+jsp+mysql

Main character design:

1. Administrator: administrator login, student management, teacher management, class management, add class, add teacher, add student, course management, add course, system user management, add user, modify password and other functions.
2. Teachers:   Teacher login, course selection management, adding course selection students, score management, adding scores, viewing student information, viewing class information, viewing personal files, modifying passwords and other functions.
3. Student: student login, course selection management, score view, view personal file, change password and other functions

Screenshot of main functions:

User login:

Enter the account password, select the user role to log in, and each role corresponds to different function permissions  

  Administrator homepage:

After the administrator logs in, the main function modules include: student management, teacher management, class management, add class, add teacher, add student, course management, add course, system user management, add user, modify password and other functions.

Add student:

Teacher management:

You can query data, add, modify and delete teacher information according to the teacher's name

  Class management

  Add class information:

  Course management and addition

 

Change Password:

  Student login system:

Main function design: student login, course selection management, score view, view personal files, modify passwords and other functions

  Teacher login system:

Teacher login, course selection management, add course selection students, score management, add scores, view student information, view class information, view personal files, modify passwords and other functions

Main source code display:  

Login form processing:

    @RequestMapping(value = "/login", method = {RequestMethod.POST})
    public String login(Userlogin userlogin) throws Exception {
        //Shiro implements login.......
        UsernamePasswordToken token = new UsernamePasswordToken(userlogin.getUsername(),
                userlogin.getPassword());
        Subject subject = SecurityUtils.getSubject();
        //If the user name cannot be obtained, the login fails. If the login fails, an exception will be thrown directly...
        subject.login(token);
        if (subject.hasRole("admin")&userlogin.getRole()==0) {
        }else throw new CustomException("Please select the correct identity to log in");
//The business layer implements dao data layer operations........
public Userlogin findByName(String name) throws Exception {
        UserloginExample userloginExample = new UserloginExample();
        UserloginExample.Criteria criteria = userloginExample.createCriteria();
        criteria.andUsernameEqualTo(name);
        List<Userlogin> list = userloginMapper.selectByExample(userloginExample);
        return list.get(0);
    }

  Course management query:

 // Course information display
    @RequestMapping("/showCourse")
    public String showCourse(Model model, Integer page) throws Exception {
        List<CourseCustom> list = null;
        //Page number object..........
        PagingVO pagingVO = new PagingVO();
        //Set total pages........
        pagingVO.setTotalCount(courseService.getCountCouse());
        if (page == null || page == 0) {
            pagingVO.setToPageNo(1);
            list = courseService.findByPaging(1);
        } else {
            pagingVO.setToPageNo(page);
            list = courseService.findByPaging(page);
        }
        model.addAttribute("courseList", list);
        model.addAttribute("pagingVO", pagingVO);
        return "admin/showCourse";
}

Teacher query:

Background data operation display, background encapsulated data and paging processing data
 // The teacher page shows......
    @RequestMapping("/showTeacher")
    public String showTeacher(Model model, Integer page) throws Exception {
        List<TeacherCustom> list = null;
        //Page number object.....
        PagingVO pagingVO = new PagingVO();
        //Set total pages..............
        pagingVO.setTotalCount(teacherService.getCountTeacher());
        if (page == null || page == 0) {
            pagingVO.setToPageNo(1);
            list = teacherService.findByPaging(1);
        } else {
            pagingVO.setToPageNo(page);
            list = teacherService.findByPaging(page);
        }
        model.addAttribute("teacherList", list);
        model.addAttribute("pagingVO", pagingVO);
        return "admin/showTeacher";
}
 //Get paging query teacher information..............................
List<TeacherCustom> findByPaging(Integer toPageNo) throws Exception;

Student information display:

 //  Student information display........
    @RequestMapping("/showStudent")
    public String showStudent(Model model, Integer page) throws Exception {
        List<StudentCustom> list = null;
        //Page number object..............
        PagingVO pagingVO = new PagingVO();
        //Set total pages...........
        pagingVO.setTotalCount(studentService.getCountStudent());
        if (page == null || page == 0) {
            pagingVO.setToPageNo(1);
            list = studentService.findByPaging(1);
        } else {
            pagingVO.setToPageNo(page);
            list = studentService.findByPaging(page);}
        model.addAttribute("studentList", list);
        model.addAttribute("pagingVO", pagingVO);
        return "admin/showStudent";
}

// Add student information.......
    @RequestMapping(value = "/addStudent", method = {RequestMethod.POST})
    public String addStudent(StudentCustom studentCustom, Model model) throws Exception {
        Boolean result = studentService.save(studentCustom);
        if (!result) {
            model.addAttribute("message", "Duplicate student number");
            return "error";
        }
        //After the addition is successful, it is also added to the login table..............
        Userlogin userlogin = new Userlogin();
        userlogin.setUsername(studentCustom.getUserid().toString());
        userlogin.setPassword("123");
        userlogin.setRole(2);
        userloginService.save(userlogin);
        //Redirect..........
        return "redirect:/admin/showStudent";
}

 // Courses taken....................
    @RequestMapping(value = "/overCourse")
    public String overCourse(Model model) throws Exception {
        //Get the current user name..........
        Subject subject = SecurityUtils.getSubject();
        StudentCustom studentCustom = studentService.findStudentAndSelectCourseListByName((String) subject.getPrincipal());
            if (studentCustom==null){
                throw new CustomException("You haven't finished any courses yet. Please choose courses to study first!");

            }
        List<SelectedCourseCustom> list = studentCustom.getSelectedCourseList();
        model.addAttribute("selectedCourseList", list);
        return "student/overCourse";
    }

Change Password:

// Reset the password of this account...................
    @RequestMapping(value = "/passwordRest", method = {RequestMethod.POST})
    public String passwordRest(String oldPassword, String password1) throws Exception {
        Subject subject = SecurityUtils.getSubject();
        String username = (String) subject.getPrincipal();
        Userlogin userlogin = userloginService.findByName(username);
        if (!oldPassword.equals(userlogin.getPassword())) {
            throw new CustomException("The old password is incorrect.......");
        } else {
            userlogin.setPassword(password1);
            userloginService.updateByName(username, userlogin);
        }
        return "redirect:/logout";
    }

Partial database design:

DROP TABLE IF EXISTS `college`;
CREATE TABLE `college` (
  `collegeID` int(11) NOT NULL,
  `collegeName` varchar(200) NOT NULL COMMENT 'Course name',
  PRIMARY KEY (`collegeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of college
-- ----------------------------
INSERT INTO `college` VALUES ('1', 'Computer Department');
INSERT INTO `college` VALUES ('2', 'Design Department');
INSERT INTO `college` VALUES ('3', 'Department of Finance and Economics');

-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS `course`;
CREATE TABLE `course` (
  `courseID` int(11) NOT NULL,
  `courseName` varchar(200) NOT NULL COMMENT 'Course name',
  `teacherID` int(11) NOT NULL,
  `courseTime` varchar(200) DEFAULT NULL COMMENT 'Opening time',
  `classRoom` varchar(200) DEFAULT NULL COMMENT 'Starting place',
  `courseWeek` int(200) DEFAULT NULL COMMENT 'Class hours',
  `courseType` varchar(20) DEFAULT NULL COMMENT 'Course type',
  `collegeID` int(11) NOT NULL COMMENT 'Affiliated colleges and departments',
  `score` int(11) NOT NULL COMMENT 'credit',
  PRIMARY KEY (`courseID`),
  KEY `collegeID` (`collegeID`),
  KEY `teacherID` (`teacherID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of course
-- ----------------------------
INSERT INTO `course` VALUES ('1', 'C Language programming', '1001', 'Tuesday', 'Section 401', '18', 'required course', '1', '3');
INSERT INTO `course` VALUES ('2', 'Python Reptile skills', '1001', 'Thursday', 'X402', '18', 'required course', '1', '3');
INSERT INTO `course` VALUES ('3', 'data structure', '1001', 'Thursday', 'Section 401', '18', 'required course', '1', '2');
INSERT INTO `course` VALUES ('4', 'Java Programming', '1002', 'Friday', 'Section 401', '18', 'required course', '1', '2');
INSERT INTO `course` VALUES ('5', 'English', '1002', 'Thursday', 'X302', '18', 'required course', '2', '2');
INSERT INTO `course` VALUES ('6', 'clothing design', '1003', 'Monday', 'Section 401', '18', 'Elective courses', '2', '2');

-- ----------------------------
-- Table structure for file
-- ----------------------------
DROP TABLE IF EXISTS `file`;
CREATE TABLE `file` (
  `fileID` varchar(100) COLLATE utf8_bin NOT NULL,
  `fileName` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `fileDesc` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `filePath` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `userID` int(11) DEFAULT NULL,
  `fileExt1` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `fileExt2` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `fileExt3` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`fileID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of file
-- ----------------------------
INSERT INTO `file` VALUES ('3192d10378ea44d88d8b558562a480e3', 'Science and engineering template.docx', 'Science and engineering template.docx', 'E://upload/3192d10378ea44d88d8b558562a480e3.docx', null, null, null, null);
INSERT INTO `file` VALUES ('59c0f03696be4e73a64c7625f1887e88', 'Measurement 1231', 'Shifu Shifu', 'E://upload/59c0f03696be4e73a64c7625f1887e88.jpg', null, null, null, null);
INSERT INTO `file` VALUES ('8a1d671ba48f441ead14255e9fda3c96', 'Measurement 123', 'wrwerwer', 'E://upload/8a1d671ba48f441ead14255e9fda3c96.sql', null, null, null, null);

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `roleID` int(11) NOT NULL,
  `roleName` varchar(20) NOT NULL,
  `permissions` varchar(255) DEFAULT NULL COMMENT 'jurisdiction',
  PRIMARY KEY (`roleID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('0', 'admin', null);
INSERT INTO `role` VALUES ('1', 'teacher', null);
INSERT INTO `role` VALUES ('2', 'student', null);

-- ----------------------------
-- Table structure for selectedcourse
-- ----------------------------
DROP TABLE IF EXISTS `selectedcourse`;
CREATE TABLE `selectedcourse` (
  `courseID` int(11) NOT NULL,
  `studentID` int(11) NOT NULL,
  `mark` int(11) DEFAULT NULL COMMENT 'achievement',
  KEY `courseID` (`courseID`),
  KEY `studentID` (`studentID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of selectedcourse
-- ----------------------------
INSERT INTO `selectedcourse` VALUES ('2', '10001', '12');
INSERT INTO `selectedcourse` VALUES ('1', '10001', '95');
INSERT INTO `selectedcourse` VALUES ('1', '10002', '66');
INSERT INTO `selectedcourse` VALUES ('2', '10003', '99');
INSERT INTO `selectedcourse` VALUES ('5', '10001', null);
INSERT INTO `selectedcourse` VALUES ('3', '10001', null);
INSERT INTO `selectedcourse` VALUES ('1', '10003', null);
INSERT INTO `selectedcourse` VALUES ('4', '10003', null);

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `userID` int(11) NOT NULL AUTO_INCREMENT,
  `userName` varchar(200) NOT NULL,
  `sex` varchar(20) DEFAULT NULL,
  `birthYear` date DEFAULT NULL COMMENT 'date of birth',
  `grade` date DEFAULT NULL COMMENT 'Admission time',
  `collegeID` int(11) NOT NULL COMMENT 'Faculty id',
  PRIMARY KEY (`userID`),
  KEY `collegeID` (`collegeID`)
) ENGINE=InnoDB AUTO_INCREMENT=10006 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of student
-- ----------------------------
INSERT INTO `student` VALUES ('9999', 'mike1', 'male', '1996-09-03', '2019-11-13', '3');
INSERT INTO `student` VALUES ('10001', 'Xiao Hong', 'male', '2020-03-02', '2020-03-02', '1');
INSERT INTO `student` VALUES ('10002', 'Little green', 'male', '2020-03-10', '2020-03-10', '1');
INSERT INTO `student` VALUES ('10003', 'Xiao Chen', 'female', '1996-09-02', '2015-09-02', '2');
INSERT INTO `student` VALUES ('10005', 'Small left', 'female', '1996-09-02', '2015-09-02', '2');

-- ----------------------------
-- Table structure for teacher
-- ----------------------------
DROP TABLE IF EXISTS `teacher`;
CREATE TABLE `teacher` (
  `userID` int(11) NOT NULL AUTO_INCREMENT,
  `userName` varchar(200) NOT NULL,
  `sex` varchar(20) DEFAULT NULL,
  `birthYear` date NOT NULL,
  `degree` varchar(20) DEFAULT NULL COMMENT 'education',
  `title` varchar(255) DEFAULT NULL COMMENT 'title',
  `grade` date DEFAULT NULL COMMENT 'Entry time',
  `collegeID` int(11) NOT NULL COMMENT 'Faculty',
  PRIMARY KEY (`userID`),
  KEY `collegeID` (`collegeID`)
) ENGINE=InnoDB AUTO_INCREMENT=1004 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of teacher
-- ----------------------------
INSERT INTO `teacher` VALUES ('1001', 'Miss Liu', 'female', '1990-03-08', 'master', 'associate professor', '2015-09-02', '2');
INSERT INTO `teacher` VALUES ('1002', 'Miss Zhang', 'female', '1996-09-02', 'doctor', 'lecturer', '2015-09-02', '1');
INSERT INTO `teacher` VALUES ('1003', 'Soft teacher', 'female', '1996-09-02', 'master', 'assistant', '2017-07-07', '1');

-- ----------------------------
-- Table structure for userlogin
-- ----------------------------
DROP TABLE IF EXISTS `userlogin`;
CREATE TABLE `userlogin` (
  `userID` int(11) NOT NULL AUTO_INCREMENT,
  `userName` varchar(200) NOT NULL,
  `password` varchar(200) NOT NULL,
  `role` int(11) NOT NULL DEFAULT '2' COMMENT 'Role permissions',
  PRIMARY KEY (`userID`),
  KEY `role` (`role`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of userlogin
-- ----------------------------
INSERT INTO `userlogin` VALUES ('1', 'admin', '123', '0');
INSERT INTO `userlogin` VALUES ('10', '10003', '123', '2');
INSERT INTO `userlogin` VALUES ('11', '10005', '123', '2');
INSERT INTO `userlogin` VALUES ('14', '1001', '123', '1');
INSERT INTO `userlogin` VALUES ('15', '1002', '123', '1');
INSERT INTO `userlogin` VALUES ('16', '1003', '123', '1');
INSERT INTO `userlogin` VALUES ('20', '9999', '123', '2');
INSERT INTO `userlogin` VALUES ('21', '10001', '123', '2');
INSERT INTO `userlogin` VALUES ('22', '10002', '123', '2');

  Generally speaking, this project is suitable for java college students to use as a reference for curriculum design or java graduation design

  OK, let's share it here today. I'm Xiao Ao. See you next time~~

  Get the complete source code:

Everyone likes, collects, pays attention to, comments and views 👇🏻👇🏻👇🏻 WeChat official account gets contact 👇🏻👇🏻👇🏻

Punch in article update   75/   100 days

  Highlight column recommendations:

100 sets of high-quality practical case of Java completion project

HTML5 operation case "100 sets"

Web operation front-end web page practice "100 sets"

Posted by Alka-Seltzer on Sun, 10 Oct 2021 16:24:40 -0700