Spring boot 定制自己的错误
摘要:1)、如何定制错误的页面; 1)、有模板引擎的情况下;error/状态码; 【将错误页面命名为 错误状态码.html 放在模板引擎文件夹里面的 error文件夹下】,发生此状态码的错误就会来到 对应的页面; 我们可以使用4xx和5xx作为错误页面的文件名来匹配这种类型的所有错误,精确优先(优
阅读全文
posted @
2018-07-15 22:07
1161588342
阅读(206)
推荐(0) 编辑
Spring boot 错误处理机制
摘要:请求方式时,若不存在 浏览器出现White label Error Page 错误页面 其他客户端出现响应一个JSON格式文本包含错误码等信息 浏览器发送请求的请求头: 客户端请求头 这样就能区分来自哪.. 原理:ErrorMvcAutoconfiguration 处理错误的自动配置 里面添加了以下
阅读全文
posted @
2018-07-15 16:21
1161588342
阅读(146)
推荐(0) 编辑
Spring boot 日志
摘要:修改spring boot 默认日志的配置 #logging.path=# 不指定路径在当前项目下生成springboot.log日志# 可以指定完整的路径;#logging.file=G:/springboot.log # 在当前磁盘的根路径下创建spring文件夹和里面的log文件夹;使用 sp
阅读全文
posted @
2018-07-14 23:15
1161588342
阅读(127)
推荐(0) 编辑
Spring boot 自动配置原理
摘要:1、自动配置原理: 1)、SpringBoot启动的时候加载主配置类,开启了自动配置功能 ==@EnableAutoConfiguration== 2)、@EnableAutoConfiguration 作用: 利用EnableAutoConfigurationImportSelector给容器中导
阅读全文
posted @
2018-07-14 21:37
1161588342
阅读(232)
推荐(0) 编辑
Spring boot 配置文件 加载顺序
摘要:springboot 启动会扫描以下位置的application.properties或者application.yml文件作为Spring boot的默认配置文件 –file:./config/ –file:./ –classpath:/config/ –classpath:/ 优先级由高到底,高
阅读全文
posted @
2018-07-14 21:29
1161588342
阅读(270)
推荐(0) 编辑
Spring boot profile 多环境配置
摘要:1、多Profile文件 我们在主配置文件编写的时候,文件名可以是 application-{profile}.properties/yml 默认使用application.properties的配置; 2、yml支持多文档块方式 3、激活指定profile 1、在配置文件中指定 spring.
阅读全文
posted @
2018-07-14 21:28
1161588342
阅读(159)
推荐(0) 编辑
Spring boot 配置文件 使用占位符号
摘要:配置文件占位符 1:使用随机数 2: 占位符获取之前配置的值,如果没有可以是用:指定默认值
阅读全文
posted @
2018-07-14 21:25
1161588342
阅读(252)
推荐(0) 编辑
Spring boot @PropertySource, @ImportResource, @Bean
摘要:@PropertySource:加载指定的配置文件 @ImportResource:导入Spring的配置文件,让配置文件里面的内容生效; Spring Boot里面没有Spring的配置文件,我们自己编写的配置文件,也不能自动识别; 想让Spring的配置文件生效,加载进来;@ImportReso
阅读全文
posted @
2018-07-14 21:24
1161588342
阅读(285)
推荐(0) 编辑
Spring boot @ConfigurationProperties 和@Value
摘要:配置文件yml还是properties他们都能获取到值; 如果说,我们只是在某个业务逻辑中需要获取一下配置文件中的某项值,使用@Value; 如果说,我们专门编写了一个javaBean来和配置文件进行映射,我们就直接使用@ConfigurationProperties;
阅读全文
posted @
2018-07-14 10:52
1161588342
阅读(125)
推荐(0) 编辑
Docker dockerfile-maven-plugin 使用
摘要:https://blog.csdn.net/liubingyu12345/article/details/79015966 背景: 环境阿里云CentOs7下面Docker部署Spring boot 项目 1:docker配置 1.1: docker安装 1.2: 开启docker 远程api 参考
阅读全文
posted @
2018-04-23 18:30
1161588342
阅读(3926)
推荐(0) 编辑
Spring boot 项目demo
摘要:https://github.com/souyunku/spring-boot-examples
阅读全文
posted @
2018-04-17 10:02
1161588342
阅读(96)
推荐(0) 编辑
Spring Boot SSO单点登入
摘要:https://github.com/ITDragonBlog/daydayup/tree/master/SpringBoot-SSO 流程图: 1: Redis 保存用户信息 到Redis(KEY->VALUE) 数据库 2: 保存Cookie信息(用户标识)到浏览器 3: 其他项目添加登入拦截器
阅读全文
posted @
2018-04-02 16:00
1161588342
阅读(311)
推荐(0) 编辑
Spring Boot 异步调用
摘要:添加一个类ThreadPoolConfig.java 方法调用 @Aync 内部实现也就是FutureTask
阅读全文
posted @
2018-03-19 18:10
1161588342
阅读(231)
推荐(0) 编辑
Spring boot 执行jar文件 方式
摘要:比如编码utf-8, 环境为test. 在这里nohup 命令使用了解一下 操作系统中有三个常用的流: 0:标准输入流 stdin 1:标准输出流 stdout 2:标准错误流 stderr 一般当我们用 > console.txt,实际是 1>console.txt的省略用法;< console.
阅读全文
posted @
2018-01-27 10:14
1161588342
阅读(385)
推荐(0) 编辑
Spring Boot @Trasactionl 失效, JDK,CGLIB动态代理
摘要:来自: https://www.cnblogs.com/sweetchildomine/p/6978037.html?utm_source=itdadao&utm_medium=referral Cglib方式 1:添加注解 2:修改yml配置 3:添加Aop依赖 默认mvc没有包括aop的 4:调
阅读全文
posted @
2018-01-22 15:06
1161588342
阅读(337)
推荐(0) 编辑
Spring boot Tomcat配置
摘要:来自: https://www.cnblogs.com/a8457013/p/7687764.html
阅读全文
posted @
2017-11-23 12:44
1161588342
阅读(129)
推荐(0) 编辑
Spring boot Thymeleaf 配置
摘要:第一步:pom.xml加入依赖 第二步: 修改yml文件 第三步:修改Controller
阅读全文
posted @
2017-09-20 17:53
1161588342
阅读(1386)
推荐(0) 编辑