diff --git a/.idea/encodings.xml b/.idea/encodings.xml index aa00ffa..e1ff5fe 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,6 +1,8 @@ + + diff --git a/pom.xml b/pom.xml index 6309899..361eac3 100644 --- a/pom.xml +++ b/pom.xml @@ -1,28 +1,37 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + com.campus campus-attendance 1.0-SNAPSHOT war - 1.8 - 5.3.30 - 3.5.13 - 8.0.33 + UTF-8 + 17 + 17 + 5.3.23 + 3.5.11 + 2.0.7 + - + + + org.springframework + spring-context + ${spring.version} + org.springframework spring-webmvc ${spring.version} - - org.springframework spring-jdbc @@ -37,27 +46,20 @@ org.mybatis - mybatis - 3.5.2 + mybatis-spring + ${mybatis.spring.version} - + mysql mysql-connector-java - ${mysql.version} + 8.0.33 com.alibaba druid - 1.2.16 - - - - - com.fasterxml.jackson.core - jackson-databind - 2.13.0 + 1.2.15 @@ -67,18 +69,54 @@ 4.0.1 provided + + javax.servlet.jsp + javax.servlet.jsp-api + 2.3.3 + provided + + + jstl + jstl + 1.2 + + + + + com.fasterxml.jackson.core + jackson-databind + 2.14.1 + campus-attendance + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.10.1 - ${java.version} - ${java.version} + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 17 + 17 + + + --enable-preview + diff --git a/src/main/java/com/campus/controller/PageController.java b/src/main/java/com/campus/controller/PageController.java new file mode 100644 index 0000000..0ac41cd --- /dev/null +++ b/src/main/java/com/campus/controller/PageController.java @@ -0,0 +1,18 @@ +package com.campus.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +public class PageController { + + @GetMapping("/") + public String index() { + return "index"; + } + + @GetMapping("/students") + public String studentList() { + return "student_list"; + } +} \ No newline at end of file diff --git a/src/main/java/com/campus/mapper/StudentMapper.xml b/src/main/java/com/campus/mapper/StudentMapper.xml deleted file mode 100644 index c1b7d1d..0000000 --- a/src/main/java/com/campus/mapper/StudentMapper.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - INSERT INTO student(name, student_id, class, major) - VALUES(#{name}, #{studentId}, #{class_}, #{major}) - - \ No newline at end of file diff --git a/src/main/resources/applicationContext.xml b/src/main/resources/applicationContext.xml index faacb09..60b7918 100644 --- a/src/main/resources/applicationContext.xml +++ b/src/main/resources/applicationContext.xml @@ -19,17 +19,24 @@ + + + + + + + diff --git a/src/main/resources/mapper/StudentMapper.xml b/src/main/resources/mapper/StudentMapper.xml new file mode 100644 index 0000000..72759e6 --- /dev/null +++ b/src/main/resources/mapper/StudentMapper.xml @@ -0,0 +1,22 @@ + + + + + + + INSERT INTO student(name, student_id, `class`, major) + VALUES(#{name}, #{studentId}, #{class_}, #{major}) + + + UPDATE student + SET name = #{name}, student_id = #{studentId}, `class` = #{class_}, major = #{major} + WHERE id = #{id} + + + DELETE FROM student WHERE id = #{id} + + \ No newline at end of file diff --git a/src/main/resources/spring-mvc.xml b/src/main/resources/spring-mvc.xml index 41de6f2..3a3a6e3 100644 --- a/src/main/resources/spring-mvc.xml +++ b/src/main/resources/spring-mvc.xml @@ -13,8 +13,6 @@ - - @@ -24,4 +22,9 @@ + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/index.jsp b/src/main/webapp/WEB-INF/jsp/index.jsp new file mode 100644 index 0000000..a57798a --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/index.jsp @@ -0,0 +1,17 @@ +<%-- + Created by IntelliJ IDEA. + User: LY + Date: 2025/12/3 + Time: 14:40 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + 首页 + + +

学生考勤系统

+学生列表 + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/student_list.jsp b/src/main/webapp/WEB-INF/jsp/student_list.jsp index 73dc8de..cd0d834 100644 --- a/src/main/webapp/WEB-INF/jsp/student_list.jsp +++ b/src/main/webapp/WEB-INF/jsp/student_list.jsp @@ -6,6 +6,7 @@ +

学生列表

@@ -23,7 +24,7 @@ html += ` - + `; });
姓名
${s.name} ${s.studentId}${s.class}${s.class_} ${s.major}