摘要: import java.util.Random; public class MyUtil { public static String getName() { Random random = new Random(); String[] Surname = {"赵", "钱", "孙", "李", 阅读全文
posted @ 2022-07-14 17:01 Dabo丶 阅读(307) 评论(0) 推荐(0) 编辑
摘要: import java.io.ByteArrayOutputStream; import java.security.KeyFactory; import java.security.KeyPair; import java.security.KeyPairGenerator; import jav 阅读全文
posted @ 2022-07-14 17:00 Dabo丶 阅读(1608) 评论(0) 推荐(0) 编辑
摘要: 请求映射 1、rest使用与原理 @xxxMapping; Rest风格支持(使用HTTP请求方式动词来表示对资源的操作) 以前:/getUser 获取用户 /deleteUser 删除用户 /editUser 修改用户 /saveUser 保存用户 现在: /user GET-获取用户 DELET 阅读全文
posted @ 2022-07-12 13:36 Dabo丶 阅读(1494) 评论(0) 推荐(0) 编辑
摘要: 欢迎页 index 1.在静态资源路径下添加 index.html 直接访问项目地址 在配置yml文件中配置静态资源访问前缀 spring: mvc: static-path-pattern: /res/** 两种访问方式访问后404 静态资源前缀影响欢迎页访问(当前SpringBoot版本spri 阅读全文
posted @ 2022-07-11 12:25 Dabo丶 阅读(1654) 评论(0) 推荐(0) 编辑
摘要: 注解中主要的三个注解 @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan(excludeFilters = { @Filter(type = FilterType.CUSTOM, classes = TypeExclude 阅读全文
posted @ 2022-07-10 09:09 Dabo丶 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 1.第一种配置@Component+@ConfigurationProperties 配置类 @Component public class MyConfig1 { @Bean public User user(){ return new User(); } }或者在User类上加@Componen 阅读全文
posted @ 2022-07-09 09:09 Dabo丶 阅读(95) 评论(0) 推荐(0) 编辑
摘要: xml配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema- 阅读全文
posted @ 2022-07-09 08:51 Dabo丶 阅读(40) 评论(0) 推荐(0) 编辑
摘要: Spring容器的refresh()【创建刷新】;1、prepareRefresh()刷新前的预处理; 1)、initPropertySources()初始化一些属性设置;子类自定义个性化的属性设置方法; 2)、getEnvironment().validateRequiredProperties( 阅读全文
posted @ 2022-07-07 13:32 Dabo丶 阅读(147) 评论(0) 推荐(0) 编辑
摘要: /** * 声明式事务: * * 环境搭建: * 1、导入相关依赖 * 数据源、数据库驱动、Spring-jdbc模块 * 2、配置数据源、JdbcTemplate(Spring提供的简化数据库操作的工具)操作数据 * 3、给方法上标注 @Transactional 表示当前方法是一个事务方法; * 阅读全文
posted @ 2022-07-01 14:19 Dabo丶 阅读(280) 评论(0) 推荐(0) 编辑
摘要: /** * AOP:【动态代理】 * 指在程序运行期间动态的将某段代码切入到指定方法指定位置进行运行的编程方式; * * 1、导入aop模块;Spring AOP: * <dependency> * <groupId>org.springframework.boot</groupId> * <art 阅读全文
posted @ 2022-06-27 16:49 Dabo丶 阅读(141) 评论(0) 推荐(0) 编辑