赞
踩
系统一共分为2个角色分别是:管理员,学生
管理员
1、登录
2、个人信息管理
3、学生管理
4、教师管理
5、课程管理
学生
1、登录
2、个人信息管理
3、查看课程
4、选课
项目简介
项目类型:Java EE项目(SSM框架)
项目名称:基于SSM的学校信息管理系统(subject)
难度等级:✩✩
用户类型:双角色(学生、管理员)
设计模式:MVC
项目架构:B/S架构
开发语言:Java语言
前端技术:layui、HTML、CSS、JS、JQuery等
后端技术:JSP、SSM框架
运行环境:Windows10、JDK1.8
运行工具:本系统采用Eclipse开发,仅支持Eclipse运行,不支持MyEclipse和IDEA运行,因为三者的骨架不一样,强行导入打开运行可能会导致出现未知的错误。(如若想用idea运行,需要转换!!!!)
数 据 库:MySQL5.5/5.7/8.0版本
运行服务器:Tomcat7.0/8.0/8.5/9.0等版本
是否基于Maven环境:否
是否采用框架:是
数据库表数量:5张表
JSP页面数量:15张左右
是否有分页:有分页
是否有代码注释:有
- <%@ page language="java" contentType="text/html; charset=utf-8"
- pageEncoding="utf-8"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
- + path + "/";
- %>
-
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>高校课程选课系统</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
- <link rel="stylesheet" type="text/css" href="<%=path %>/layui/css/layui.css">
- <link rel="stylesheet" type="text/css" href="<%=path %>/layui/css/admin.css">
- <link rel="stylesheet" type="text/css" href="<%=path %>/layui/css/login.css">
- </head>
- <body>
-
-
- <form action="<%=path %>/login" method="post" onSubmit="return tijiao(this)" id="loginForm" name="loginForm">
- <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">
- <div class="layadmin-user-login-main">
- <div class="layadmin-user-login-box layadmin-user-login-header">
- <h2>高校选课系统登陆界面</h2>
-
- </div>
- <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
- <div class="layui-form-item">
- <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-cellphone"></label>
- <input type="text" name="userName" lay-verify="userName" id="userName" placeholder="用户名" class="layui-input">
- </div>
-
- <div class="layui-form-item">
- <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
- <input type="password" name="password" lay-verify="password" id="password" placeholder="密码" class="layui-input">
- </div>
- <div class="layui-form-item" style="align:center;">
-    
- <!-- <div class="layui-input-block"> -->
- <input type="radio" name="type" value="1" title="管理员" checked>
- <!-- <input type="radio" name="type" value="2" title="老师">
- --> <input type="radio" name="type" value="3" title="学生">
- <!-- </div> -->
- </div>
- <div class="layui-form-item">
- <!-- <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-reg-submit">注 册</button> -->
- <button type="submit" id="denglu" class="layui-btn layui-btn-fluid">登陆</button>
-
- </div>
-
- <!-- <div class="layui-form-item">
- <a href="toRegister" class="layui-btn layui-btn-fluid" >去注册</a>
- </div> -->
- <span id="error2" style="color:red;">${msg1}</span>
- </div>
- </div>
-
-
-
- </div>
-
-
-
-
- <script src="<%=path %>/layui/layui.js"></script>
- <script>
-
- layui.use([ 'form','jquery','layer' ], function() {
- var form = layui.form,
- layer = layui.layer,
- $= layui.jquery;
- form.render();//这句一定要加,占坑
-
- $("#account").blur(function(){
- $("#error").html("");
- $("#error2").html("");
- })
- $("#pwd").blur(function(){
- $("#error1").html("");
- $("#error2").html("");
- })
-
-
-
- $('#denglu').click(function(){
- var userName = $.trim($('#userName').val());
- var password = $.trim($("#password").val());
- if(userName == ''){
- layer.msg('用戶名不能为空',function() {time:2000});
- return false;
- }
- if(password == ''){
- layer.msg('密码不能为空',function() {time:2000});
- return false;
- }
- })
-
-
-
- });
- </script>
- </body>
- </html>
-
- @RequestMapping("/login")
- public ModelAndView login(@RequestParam("userName")String userName,
- HttpServletRequest request,@RequestParam("password")String password,
- HttpSession session,HttpServletResponse response,ModelAndView mv) throws ServletException, IOException {
- session.removeAttribute("admin");
- session.removeAttribute("teacher");
- session.removeAttribute("student");
- String type=request.getParameter("type").toString();
- Admin admin =new Admin();
- Teacher teacher = new Teacher();
- Student student = new Student();
- if(type != null && type.equals("1")){//管理员
- admin.setGmid(userName);
- admin.setGmpwd(password);
- Admin admin1 = service.selectUser(admin);
- if(admin1 == null){
- mv.addObject("msg1", "管理员账号不存在或者密码错误!");
- mv.setViewName("views/login");
- }else{
- mv.addObject("admin", admin1);
- request.getSession().setAttribute("admin", admin1);
- mv.setViewName("views/main");
- }
- }else if(type != null && type.equals("3")){
- student.setStno(userName);
- student.setStpass(password);
- Student stu = service.selectStudent(student);
- if(stu == null){
- mv.addObject("msg1", "学生账号不存在或者密码错误!");
- mv.setViewName("views/login");
- }else{
- mv.addObject("student", stu);
- request.getSession().setAttribute("student", stu);
- mv.setViewName("views/main");
- }
- }
- return mv;
-
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。