![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring boot
tinysakurac
蹒跚学步的猿
展开
-
springboot开启热部署
热启动在正常开发项目中已经很常见了吧,虽然平时开发web项目过程中,改动项目启重启总是报错;但springBoot对调试支持很好,修改之后可以实时生效,需要添加以下的配置:<dependencies> <dependency> <groupId>org.springframework.boot</groupId>...原创 2018-09-07 06:46:24 · 124 阅读 · 0 评论 -
Spring Boot中使用AOP
spring boot 中使用AOP,需要先在pom.xml中添加依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId...转载 2018-10-23 14:40:53 · 1200 阅读 · 0 评论 -
SpringBoot使用MockMvc对Controller进行测试
spring-mvc springboot 使用MockMvc对controller进行测试网上基本都是参考官方的使用方式,使用了import static,个人感觉这种方式特别不好,代码提示性不友好。所以在此进行说明,也方便自己以后使用。1.引入spring-test相关jar包,springboot只需引入spring-boot-starter-test即可<dependency&...转载 2018-11-06 17:00:26 · 1424 阅读 · 0 评论 -
SpringBoot中使用applicationContext.xml配置文件
SpringBoot 默认是通过Java代码进行依赖注入,但也为xml形式的依赖注入提供了入口,就是@ImportResource注解。我们可以在SpringBoot的启动类上添加这个注解并在注解的locations属性中指定xml配置文件。(可以使用一个文件集合也可以只引入主配置文件然后在主配置文件中使用<import>标签引入其他子配置文件,个人更喜欢第二中方式)。这样容器在启动...原创 2018-11-06 19:34:16 · 17868 阅读 · 0 评论 -
springboot启动原理解析
转载自每天进步一点的博客[https://www.cnblogs.com/zheting/p/6707035.html]转载 2018-12-06 19:37:08 · 176 阅读 · 0 评论 -
SpringBoot嵌入式servlet容器启动原理
转载自caychen的博客SpringBoot嵌入式servlet容器启动原理从源码的角度分析SpringBoot内嵌的servlet容器是怎么启动的Spring Boot应用启动运行run方法:public ConfigurableApplicationContext run(String... args) { StopWatch stopWatch = new StopWat...转载 2018-12-06 20:07:08 · 347 阅读 · 0 评论 -
springboot actuator的使用
有关actuator的详细使用教程以及端点返回信息含义的内容可以访问博客https://www.jianshu.com/p/af9738634a21原创 2018-09-07 18:36:19 · 170 阅读 · 0 评论 -
springboot无法访问actuator下的部分敏感端点的解决方式
错误信息: Tue Mar 07 21:18:57 GMT+08:00 2017 There was an unexpected error (type=Unauthorized, status=401). Full authentication is required to access this resource. 解决: application.properties添加配...转载 2018-09-07 17:19:13 · 808 阅读 · 1 评论 -
SpringBoot集成WebSocket实时通信
转载自飞污熊的博客WebSocketWebSocket是 HTML5 开始提供的一种浏览器与服务器间进行全双工通讯的网络技术。 WebSocket 通信协议于2011年被IETF定为标准RFC 6455,WebSocketAPI 被W3C定为标准。 在WebSocket API 中,浏览器和服务器只需要要做一个握手的动作,然后,浏览器和服务器之间就形成了一条快速通道。两者之间就直接可以数据互相...转载 2019-01-02 17:06:30 · 4351 阅读 · 0 评论 -
个人开源项目smart_search_box
recommendsmart_search_box是java领域的一站式搜索引擎解决方案,用户只需要进行简单的配置就可以在项目中引入完整的全文搜索能力,包括数据入库自动索引,搜索词联想,热词提示,高亮等功能。同时提供给用户高度的自定义能力,用户可以替换框架的部分实现,包括替换elastic search客户端,替换分词器,替换redis客户端等,只需要实现对应的接口替换默认注入的相应组件即可。默...原创 2019-05-18 14:39:21 · 338 阅读 · 0 评论 -
Spring Mvc对自定义controller入参预处理
转载自xdoyf的博客在初学springmvc框架时,我就一直有一个疑问,为什么controller方法上竟然可以放这么多的参数,而且都能得到想要的对象,比如HttpServletRequest或HttpServletResponse,各种注解@RequestParam、@RequestHeader、@RequestBody、@PathVariable、@ModelAttribute等。相信很多...转载 2019-07-29 15:43:55 · 1517 阅读 · 0 评论 -
spring boot中使用servlet、listener与filter
转载自MarsWang的博客(https://www.cnblogs.com/wangbin2188/p/9199452.html)spring boot中支持使用java Web三大组件(servlet、listener和filter),但是坑比较多,主要是spring boot内嵌tomcat和独立tomcat服务器有一些细节上的不同,踩完之后,特有此记。一、spring boot内嵌服务...转载 2018-10-15 10:13:37 · 188 阅读 · 0 评论 -
在springboot中使用统一参数校验
开发web项目有时候我们需要对controller层传过来的参数进行一些基本的校验,比如非空,非null,整数值的范围,字符串的个数,日期,邮箱等等。最常见的就是我们直接写代码校验,这样以后比较繁琐,而且不够灵活。Bean Validation 1.0(JSR-303)是一个校验规范,在Spring Boot项目由于自带了Hibernate validator 5(http://hibernat...转载 2018-09-27 18:52:50 · 4649 阅读 · 0 评论 -
springboot引入web模块
引入web模块1、pom.xml中添加支持web的模块: &lt;dependency&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&原创 2018-09-07 06:49:02 · 5733 阅读 · 2 评论 -
springboot整合mybatis
转载自博客https://www.cnblogs.com/peterxiao/p/7779188.html转载 2018-09-07 08:09:57 · 89 阅读 · 0 评论 -
spring boot集成redis
springboot使用redis的配置application.yml连接池以及存取 第一步:添加pom文件依赖: redis.clients jedis 2.9.0 第二步:配置application文件按 Ctrl+C 复制代码jedis : pool :...转载 2018-09-07 14:05:32 · 113 阅读 · 0 评论 -
spring使用@value读取yml文件
AML 是专门用来写配置文件的语言。@Data@Componentpublic class Product{ @Value("${product.name}") private String name; @Value("${product.nickName}") private String nickName;}application.yml ...转载 2018-09-07 14:08:10 · 11161 阅读 · 0 评论 -
详解springboot的yml文件
关于springboot中yml文件的相关知识转载 2018-09-07 14:14:26 · 578 阅读 · 0 评论 -
springboot配置logback打印sql日志
1.如果使用application.properties在配置中添加:logging.level.com.looedu.mapper=debug格式:logging.level.Mapper类的包=debug2.如果使用application.yml在配置中添加:logging: level: com: looedu: mappe...转载 2018-09-07 14:32:14 · 3513 阅读 · 0 评论 -
spring mvc请求参数接收的全面解析
转载自spring mvc请求参数接收的全面解析作者从源码角度,分析了不同的类型请求对应使用的参数解析器(继承自HandlerMethodArgumentResolver的一系列参数解析器)以及参数转换器(实现了HttpMessageConverter接口的一系列参数转换器)。可以说干货满满了,推荐所有对spring mvc参数接收有疑问的同学阅读一波。...转载 2018-09-25 22:24:54 · 199 阅读 · 0 评论 -
springboot配置优先级
Spring Boot 所提供的配置优先级顺序比较复杂。按照优先级从高到低的顺序,具体的列表如下所示。1命令行参数。2通过 System.getProperties() 获取的 Java 系统参数。3操作系统环境变量。4从 java:comp/env 得到的 JNDI 属性。5通过 RandomValuePropertySource 生成的“random.*”属性。6应用 Jar 文...转载 2018-09-20 14:30:06 · 1296 阅读 · 0 评论 -
springboot为什么引入一些依赖时不需要指定版本
JPA顾名思义就是Java Persistence API的意思,是JDK 5.0注解或XML描述对象-关系表的映射关系,并将运行期的实体对象持久化到数据库中。spring data jpa中怎么映射实体类与表,相关注解的使用以及方法名与sql的对应关系可以参考这篇博客spring boot 中使用 jpa以及jpa介绍...转载 2018-09-20 18:57:34 · 9816 阅读 · 0 评论 -
springboot全局异常处理
在spring 3.2中,新增了@ControllerAdvice 注解,可以用于定义@ExceptionHandler、@InitBinder、@ModelAttribute,并应用到所有@RequestMapping中。参考:@ControllerAdvice 文档一、介绍创建 MyControllerAdvice,并添加 @ControllerAdvice注解。package co...转载 2018-09-27 18:38:16 · 486 阅读 · 0 评论 -
@SpringBootApplication的组件扫描范围
转载自乌龟壳的博客@SpringBootApplication=@Configuration+@EnableAutoConfiguration+@ComponentScan,其中扫描包的范围为启动类所在包和子包,不包括第三方的jar包。如果我们需要扫描通过maven依赖添加的jar,我们就要单独使用@ComponentScan注解扫描第三方包。但是,如果@SpringBootApplicati...转载 2019-07-30 19:55:55 · 2010 阅读 · 0 评论