JavaEE修复残留的cookie错误

This commit is contained in:
maxxie 2024-10-20 21:47:06 +08:00
parent e81b27b8f3
commit 2334abff3b
4 changed files with 9 additions and 18 deletions

View File

@ -5,6 +5,7 @@
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/C05-1-MyBatis-XML-Demo/pom.xml" />
<option value="$PROJECT_DIR$/SimpleStudentManagementSystem/pom.xml" />
</list>
</option>
</component>

View File

@ -33,3 +33,6 @@
4. 删除某个人某条成绩
##### 选做内容
1. 查询某人成绩同时计算平均分
### 更新内容
1. 2024-10-20: 更新化简项目后残留的cookie

View File

@ -24,11 +24,9 @@ public class StudentController {
public String getStudentPage(){
return "student";
}
@GetMapping("addstudentpage")
public String addStudentPage(@CookieValue(value = "username")String username, Model model){
Account account = new Account();
account.setAccount(username);
model.addAttribute("account",account);
public String addStudentPage(){
return "addstudent";
}
// 处理数据

View File

@ -1,33 +1,22 @@
spring.application.name=SimpleStudentManagementSystem
#热部署生效
spring.devtools.restart.enabled=true
#设置重启目录
spring.devtools.restart.additional-paths=src/main/java
# 指定时区 避免因时区差异而导致的日期时间解析错误
spring.jackson.time-zone=Asia/Shanghai
#设置 cLasspath 目录下的WEB-INF文件夹内容修改不重启(有静态资源才需要)(需要修改成对应值)
spring.devtools.restart.exclude=static/**
# 数据库驱动
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# 数据库链接(需要修改成对应值)
spring.datasource.url=jdbc:mysql://localhost:3306/mybatis
# 数据库账号(需要修改成对应值)
spring.datasource.username=root
# 数据库密码(需要修改成对应值)
spring.datasource.password=123456
# 配置 mybatis 的日志,指定输出到控制台
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
# 开启 mybatis 的驼峰命名自动映射开关
mybatis.configuration.map-underscore-to-camel-case=true
# 配置 mybatis 的映射文件路径
mybatis.mapper-locations=classpath*:mapper/*.xml
# 自动为包下所有Java类注册类型别名需要修改成对应值
mybatis.type-aliases-package=edu.maxxie.pojo
# 启用事务管理
spring.transaction.annotation-proxy-target-class=true
# Thymeleaf 配置
server.port=8080
server.servlet.context-path=/
spring.thymeleaf.cache=false