摘要: Spring 条件装配 简介 从 Spring Framework 3.1 开始,允许在 Bean 装配时增加前置条件判断 条件注解举例 注解 场景说明 @Profile 配置化条件装配 @Conditional 编程条件装配 实现方式 配置方式,@Profile 编写服务层接口 public in 阅读全文
posted @ 2020-06-01 10:35 樊梨花大大王 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Spring @Enable模块装配 定义 Spring Framework 3.1 开始支持”@Enable 模块驱动“。所谓“模块”是指具备相同领域的功能组件集合, 组合所形成一个独立 的单元。比如 Web MVC 模块、AspectJ代理模块、Caching(缓存)模块、JMX(Java 管 阅读全文
posted @ 2020-06-01 10:33 樊梨花大大王 阅读(269) 评论(0) 推荐(0) 编辑
摘要: resstFul服务文件上传下载 上传 在测试类中使用MocekMvc伪造上传文件请求 @RunWith(SpringRunner.class) @SpringBootTest(classes = DemoApplication.class) public class UserControllerT 阅读全文
posted @ 2020-06-01 09:49 樊梨花大大王 阅读(118) 评论(0) 推荐(0) 编辑
摘要: MockMvc MockMvc import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; import static org.springframework.test.web.s 阅读全文
posted @ 2020-06-01 09:47 樊梨花大大王 阅读(602) 评论(0) 推荐(0) 编辑
摘要: resstFul服务文件上传下载 上传 在测试类中使用MocekMvc伪造上传文件请求 @RunWith(SpringRunner.class) @SpringBootTest(classes = DemoApplication.class) public class UserControllerT 阅读全文
posted @ 2020-06-01 09:44 樊梨花大大王 阅读(119) 评论(0) 推荐(0) 编辑
摘要: SpringBoot 拦截RestFul 服务 使用拦截器 使用@Component注解并继承HandlerInterceptor接口,拦截的controller类中的方法 @Component public class CustomInterceptor implements HandlerInt 阅读全文
posted @ 2020-06-01 09:43 樊梨花大大王 阅读(410) 评论(0) 推荐(0) 编辑
摘要: SringBoot 异常处理 Spring Boot 中默认的错误处理机制 spring boot 应用默认对浏览器请求和Http请求错误处理不同方法 spring boot 默认异常处理类 @Controller @RequestMapping("${server.error.path:${err 阅读全文
posted @ 2020-06-01 09:23 樊梨花大大王 阅读(187) 评论(0) 推荐(0) 编辑
摘要: springBoot核心技术概览 核心特性 组件自动装备(webMVC, web Flux,JDBC等) 激活: @EnableAutoConfiguration 配置: /META-INF/spring.factories 实现: XXXAutoConfiguration 嵌入式Web容器 Web 阅读全文
posted @ 2020-06-01 09:22 樊梨花大大王 阅读(355) 评论(0) 推荐(0) 编辑