会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小白冲冲
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
下一页
2022年8月2日
Spring boot: csrf
摘要: 当我们在spring boot的configure中disable掉csrf时就避免了以上这种可能性。 当csrf是enable时项目是这样运行的: 从Spring Security 4.0开始,默认情况下会启用CSRF保护,以防止CSRF攻击应用程序,Spring Security CSRF会针对
阅读全文
posted @ 2022-08-02 04:20 小白冲冲
阅读(1587)
评论(0)
推荐(0)
2022年7月24日
Java: List.stream()
摘要: // students是一个List,stream()表示循环students中的itemsstudents.stream() // filter表示过滤items中符合条件的,student是当前item,studentId是一个parameter .filter(student -> stude
阅读全文
posted @ 2022-07-24 23:07 小白冲冲
阅读(560)
评论(0)
推荐(0)
2022年7月22日
sql:drop column 报错
摘要: ALTER TABLE table_name DROP COLUMN column_name 运行时报错 这时我们需要先删除这个依赖 ALTER TABLE table_name DROP CONSTRAINT DF__role__MANAGE_MAC__2B2A60FE 运行完删除依赖指令后我们就
阅读全文
posted @ 2022-07-22 15:50 小白冲冲
阅读(309)
评论(0)
推荐(0)
2022年7月19日
10. Spring security
摘要: 依赖 <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-security</artifactid> </dependency> 添加依赖后,项目中所有资源都会被保护起来。启
阅读全文
posted @ 2022-07-19 05:47 小白冲冲
阅读(162)
评论(0)
推荐(0)
8.3 单元测试,包括security测试
摘要: 创建一个Spring Boot 项目时会自动创建一个test文件夹,所有的测试都在其中进行。 依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artif
阅读全文
posted @ 2022-07-19 05:32 小白冲冲
阅读(191)
评论(0)
推荐(0)
2022年7月18日
7.2 JPA 实现 REST
摘要: 在Spring Boot 中,使用Spring Data JPA 和Spring Data Rest 可以快速开发出一个RESTful 应用。 自动将repository转换为rest资源,可不提供controller层接口直接访问数据。 依赖 <dependency> <groupid>org.s
阅读全文
posted @ 2022-07-18 00:01 小白冲冲
阅读(173)
评论(0)
推荐(0)
2022年7月13日
6.2 整合MongoDB (NoSQL 数据库)
摘要: 1. 在Spring Boot Web 工程, 添加MongoDB 依赖 <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-data-mongodb</artifactid
阅读全文
posted @ 2022-07-13 05:22 小白冲冲
阅读(84)
评论(0)
推荐(0)
2022年7月10日
5.3 整合Spring Data JPA
摘要: JPA CJava Persistence APD 和Spring Data 是两个范畴的概念。 Hibernate 是一个ORM 框架,而JPA 则是一种ORM 规范。而Hibernate 是这些规范的实现(事实上, 是先有Hibernate 后有JPA, JPA 规范的起草者也是Hibernat
阅读全文
posted @ 2022-07-10 23:46 小白冲冲
阅读(65)
评论(0)
推荐(0)
5.1 整合 JdbcTemplate
摘要: JdbcTemplate 是Spring 提供的一套JDBC模板框架,利用AOP 技术来解决直接使用JDBC 时大量重复代码的问题。JdbcTemplat巳虽然没有MyBatis 那么灵活,但是比直接使用JDBC 要方便很多。Spring Boot 中对JdbcTemplate 的使用提供了自动化配
阅读全文
posted @ 2022-07-10 23:11 小白冲冲
阅读(42)
评论(0)
推荐(0)
2022年7月8日
4.9. 启动系统任务
摘要: 有一些特殊的任务需要在系统启动前执行,例如配置文件加载、数据库初始化等操作。如果没有使用Spring Boot,这些问题可以在Listener 中解决。Spring Boot 对此提供了两种解决方案:CommandLineRunner 和ApplicationRunner 。CommandLineR
阅读全文
posted @ 2022-07-08 05:22 小白冲冲
阅读(41)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
下一页
公告