文章分类 - spring
摘要:引入相关依赖 加入mysql数据库连接 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.19</version> </dependency> 加入数据库j
阅读全文
摘要:1. HTTP响应格式、内容  2. spring security 认证请求参数示例,使用请求头传递用户、密码信
阅读全文
摘要:## 安全配置 1. pom.xml ```xml org.springframework.boot spring-boot-starter-parent 2.7.7 org.springframework.boot spring-boot-starter-security org.springfr
阅读全文
摘要:## maven,pom.xml ```xml org.springframework.boot spring-boot-starter-thymeleaf org.webjars webjars-locator-core org.webjars bootstrap 4.5.0 ``` ## web
阅读全文
摘要:## 配置csrf、rememberMe ```java @Configuration @EnableWebSecurity(debug = true) // 开启调试模式,生产环境不要使用 public class SecurityConfig { @Bean public SecurityFil
阅读全文
摘要:## 说明 通过自定义认证filter,替换掉默认的表单认证,改用json接收登录请求参数。自定义响应处理方法,登录成功或失败后响应json数据 ## 配置说明: `UsernamePasswordAuthenticationFilter`: 以表单提交方式处理身份认证,提交用户名密码参数到`POS
阅读全文
摘要:> 环境准备 - spring boot 2.7.x ## 一、添加maven坐标 ```xml org.springframework.boot spring-boot-starter-jdbc com.h2database h2 runtime ``` ## 二、属性配置 `applicatio
阅读全文
摘要:项目环境: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.7.11</version> <relativePath
阅读全文
摘要:自定义注解添加国际化 向spring boot注入LocalValidatorFactoryBean实例 /** * 核心配置 */ @Configuration @RequiredArgsConstructor public class SecurityConfig { // 引入spring基础
阅读全文
摘要:常用的验证注解注解 引入maven坐标 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> 实体添
阅读全文

浙公网安备 33010602011771号