
SpringBoot
使用Spring Boot可以轻松地创建独立的,基于生产级别的基于Spring的应用程序,您可以“运行”它们。
我们对Spring平台和第三方库持固执己见的观点,因此您可以以最小的麻烦开始使用。大多数Spring Boot应用程序需要最少的Spring配置。
行思坐忆,志凌云
务实北斗应用之星火,畅想北斗产品之燎原
展开
-
SpringBoot配置加载顺序
原创 2020-09-12 18:51:57 · 162 阅读 · 0 评论 -
spring-boot-starter家族成员简介
以下应用程序starters是Spring Boot在org.springframework.boot组下提供的:名称描述spring-boot-starter核心Spring Boot starter,包括自动配置支持,日志和YAMLspring-boot-starter-actuator生产准备的特性,用于帮我们监控和管理应用spring-boot-starter-amqp对”高级消息队列协议”的支持,通过spring-rabbit实现spring-boo...转载 2020-08-18 21:28:34 · 199 阅读 · 0 评论 -
Thymeleaf模板的相关配置
SpringBoot项目中使用Thymeleaf模板需要做如下引用<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>如有需要修改默认配置的时候,只需复制下⾯要修改的属性到 application.properties 中,并修改原创 2020-07-27 21:37:03 · 331 阅读 · 0 评论 -
SpringBoot项目中application.properties文件使用随机数(字符串,数字)
# 随机字符串 com.didispace.blog.value=${random.value} # 随机int com.didispace.blog.number=${random.int} # 随机long com.didispace.blog.bignumber=${random.long} # 10以内的随机数com.didispace.blog.test1=${random.int(10)} # 10-20的随机数 com.didispace.blog.test2=${rando原创 2020-07-26 21:11:48 · 1057 阅读 · 0 评论 -
web项目后台判断接口传递参数的对象中的属性是否为空
前言:抽象出统一判断对象中属性是否为空,可用于检测接口传递的参数中是否有为空的情况,项目解耦。工具类代码:import java.lang.reflect.Field;import java.util.ArrayList;import java.util.HashMap;import java.util.List;/** * @program: wfanalysisplatfor...原创 2020-01-15 13:37:52 · 1147 阅读 · 0 评论 -
SpringBoot后台报错Template might not exist or might not be accessible
经多方查找问题原因如下1 在controller层请求处理完了返回时,没有使用@RestController或@ResponseBody而返回了非json格式这种情况下返回的数据thymeleaf模板无法解析,直接报错,本人正式因为这个原因才报错。解决方案:可以将@Controller换成@RestController,不过需要注意有没有其他的方法返回了html页面,会导致返回的不是页面而是...原创 2019-11-05 15:14:26 · 4092 阅读 · 0 评论 -
springboot框架直接访问静态页面
1、将静态页面放置如下路径2、pom.xml中添加依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId><...原创 2019-10-14 14:07:36 · 438 阅读 · 0 评论 -
springboot自定义异常的两种方式
Springboot异常的处理,可以通过一下几种方法,1、使用@ControllerAdvice来进行统一异常处理,@Excep...转载 2019-10-10 10:59:17 · 191 阅读 · 0 评论 -
springboot实现自定义异常
步骤:分为三步1、自定义异常类package exception;/** * 自定义异常类 * */public class xdException extends RuntimeException{ /** * 状态码 * */ private Integer code; /** * 异常信息 * */ priv...原创 2019-10-10 10:57:21 · 150 阅读 · 0 评论 -
dubbo与springboot版本对应问题
原创 2019-08-13 11:47:39 · 1404 阅读 · 0 评论 -
@ConfigurationProperties 与 @Value 对比
目录本文导读@Value 取值注入application. ymlPOJO 属性取赋值测试 运行@ConfigurationProperties VS @Value本文导读1、@Value 与 @ConfigurationProperties 都可以从全局配置文件中获取值然后注入到属性中2、本来主要讲解两种取值以及注入值...转载 2019-07-04 17:27:58 · 202 阅读 · 0 评论 -
idea2019创建一个springboot项目(hello world)
IDEA创建一个SpringBoot项目1.首先点击"Create New Project",创建一个新项目.2.点击"Spring Initializr", 选择自己的JDK版本, 点击"Next".3.点击Next""4.点击"Web",选择"Web",点击"Next",5.点击"Finish",完成.一个简单的springboot项目就创建完...原创 2019-07-02 09:00:53 · 20879 阅读 · 2 评论