——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
学生成绩的增删改查管理





技术框架
JavaBean MVC JSP SSM(Spring SpringMVC MyBatis) Maven MySQL Bootstrap JavaScript
基于javaweb的SSM+Maven学生成绩管理系统(java+jsp+maven+ssm+mysql)
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| .login-center-img > img { width: 100%; }
.login-center-input { float: left; width: 230px; margin-left: 15px; height: 30px; position: relative; }
.login-center-input input { z-index: 2; transition: all 0.5s; padding-left: 10px; color: #333333; width: 100%; height: 30px; border: 0; border-bottom: 1px solid #cccccc; border-top: 1px solid #ffffff; border-left: 1px solid #ffffff; border-right: 1px solid #ffffff; box-sizing: border-box; outline: none; position: relative; }
.login-center-input input:focus { border: 1px solid dodgerblue; }
.login-center-input input:focus ~ .login-center-input-text { top: 0; z-index: 3; opacity: 1; margin-top: -15px; }
.login-button { cursor: pointer; width: 250px; text-align: center; height: 40px;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| return classid; }
public void setClassid(String classid) { this.classid = classid; }
public String getTeacher() { return teacher; }
public void setTeacher(String teacher) { this.teacher = teacher; }
public Integer getScore() { return score; }
public void setScore(Integer score) { this.score = score; }
public String getSubject() { return subject; }
public void setSubject(String subject) { this.subject = subject; }
@Override public String toString() { return "Student{" + "id=" + id + ", name='" + name + '\'' + ", classid='" + classid + '\'' + ", teacher='" + teacher + '\'' + ", score=" + score + ", subject='" + subject + '\'' +
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
@Controller public class LoginController {
@Autowired private UserService userService;
@RequestMapping("login") public void login(HttpServletRequest request, HttpServletResponse response) throws Exception { request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); HttpSession session = request.getSession();
User user = userService.get(request.getParameter("username"), request.getParameter("password"));
if (user != null) { session.setAttribute("msg", "Login Success!!!"); session.setAttribute("url", "/selectStudentAll"); } else { session.setAttribute("msg", "username or password was wrong!"); session.setAttribute("url", "/login.jsp"); } request.getRequestDispatcher("/forward.jsp").forward(request, response); } } package com.demo.service;
@Service public class StuServiceImpl implements StudentService { @Autowired
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| Student updateStudentEdit(int id);
void upadateStudent(Student student);
void insertStudent(Student student);
} package com.demo.mapper;
public interface UserMapper {
List<User> findAllSplit(Map<String, Object> params);
} package com.demo.service;
public interface UserService { User get(String username, String password); } <%-- Created by IntelliJ IDEA. User: EDZ Time: 11:28 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <html> <head> <title>学生成绩管理系统</title>
<script type="text/javascript" src="https://cdn.staticfile.org/twitter-bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| private Integer id; private String username; private String password;
public Integer getId() { return id; }
public void setId(Integer id) { this.id = id; }
public String getUsername() { return username; }
public void setUsername(String username) { this.username = username; }
public String getPassword() { return password; }
public void setPassword(String password) { this.password = password; } } package com.demo.mapper;
public interface StudentMapper { public List<Student> selectStudentAll(ParamsStu params);
void deleteStudent(int id);
Student updateStudentEdit(int id);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| 学科:<input type="text" name="subject" value="${par.subject}" size="6"/> 老师姓名:<input type="text" name="teacher" value="${par.teacher}" size="6"/> <br/> <br/> 学生成绩:<input type="text" name="scoreFrom" value="${par.scoreFrom}" size="6"/> ---<input type="text" name="scoreTo" value="${par.scoreTo}" size="6"/> <%--条件搜索后:分页--%> <input id="pn" type="hidden" name="pageNum" value="${pageInfo.pageNum}"> <%--页面动态设置每页条数--%> <input id="ps" type="hidden" name="pageSize" value="${pageInfo.pageSize}"> <input type="submit" class="btn btn-primary" value="搜索"> </form> </div> <%--数据展示--%> <table border="1" align="center" class="table table-striped table-hover table-bordered"> <tr> <td>学生编号</td> <td>学生姓名</td> <td>班级编号</td> <td>学科</td> <td>老师姓名</td> <td>学生成绩</td> <td>等及</td> <td>操作</td> </tr>
<c:forEach items="${pageInfo.list}" var="stu" varStatus="vs"> <tr> <td>${vs.count+(pageInfo.pageNum-1)*pageInfo.pageSize}</td> <td>${stu.name}</td> <td>${stu.classid}</td> <td>${stu.subject}</td> <td>${stu.teacher}</td> <td>${stu.score}</td> <td><c:if test="${stu.score>=90}">优</c:if><c:if test="${stu.score<90 and stu.score>=80 }">良</c:if><c:if test="${stu.score<80 and stu.score>=60}">合格</c:if><c:if test="${stu.score<60}">不合格</c:if></td> <td><a href="${pageContext.request.contextPath}/deleteStudent/${stu.id}"><input type="submit" class="btn btn-danger" value="删除"></a> <a href="${pageContext.request.contextPath}/updateStudentEdit/${stu.id}"><input type="submit" class="btn btn-info" value="修改"></a></td> </tr> </c:forEach> </table> <%--分页--%> <table align="center"> <tr> <td><a href="javascript:toPage(1);"><button type="button" class="btn btn-default btn-sm">首页</button></a></td> <td><a href="javascript:toPage(${pageInfo.pageNum-1});"><button type="button" class="btn btn-default btn-sm">上一页</button></a></td> <td><a href="javascript:toPage(${pageInfo.pageNum+1});"><button type="button" class="btn btn-default btn-sm">下一页</button></a></td> <td><a href="javascript:toPage(${pageInfo.pages});"><button type="button" class="btn btn-default btn-sm">尾页</button></a></td> <td>设置每页条数 <select id="pageSize" onchange="toPage(1)"> <option <c:if test="${pageInfo.pageSize==2}">selected</c:if>>2</option> <option <c:if test="${pageInfo.pageSize==5}">selected</c:if>>5</option>
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=081921381902104aa
https://javayms.pages.dev?id=081921381902104aa