Spring Boot 1、热部署 2、SpringBoot资源文件属性配置 3、SpringBoot资源文件配置server 4、SpringBoot整合模板引擎 5、SpringBoot配置全局的异常捕获 6、SpringBoot整合redis 7、SpringBoot整合定时任务task 8、SpringBoot整合异步任务 9、SpringBoot拦截器的使用 10、springboot指定端口的三种方式


Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

热部署配置:
Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

2、SpringBoot资源文件属性配置

Spring Boot资源文件属性配置;
必须在Pom.xml中进行配置。
Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

3、SpringBoot资源文件配置server

3.1 Server服务端相关配置

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

3.2 资源文件中配置tomcat相关属性

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

4、SpringBoot整合模板引擎

4.1 整合freemarker

引入依赖:
Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式


配置: ![freemarker配置](https://img-blog.****.net/20180905092638465?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FuMTA5MDIzOTc4Mg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)

4.2 整合thymeleaf

引入依赖:
Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

配置:
Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

5、SpringBoot配置全局的异常捕获

5.1 页面跳转形式

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

5.2 ajax形式

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式


5.3 统一返回异常的形式

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式


Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

6、SpringBoot整合redis

首先,pom.xml中引入依赖,然后在资源文件中对redis进行配置。

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式


![redis配置](https://img-blog.****.net/20180905100518691?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FuMTA5MDIzOTc4Mg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

7、SpringBoot整合定时任务task

使用注解@EnableScheduling开启定时任务,会自动扫描。

定义@Component作为组件被容器扫描。

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式


Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式


7.1 定时任务表达式的应用:

表达式生产地址:http://cron.qqe2.com

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

8、SpringBoot整合异步任务

使用注解@EnableAsynv开启异步,会自动扫描。

定义@Component @Async作为组件被容器扫描执行 。

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式


Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

使用场景:
- 发送短信
- 发送邮件
- APP消息推送
- 节省运维凌晨发布任务时间提供效率

9、SpringBoot拦截器的使用

使用注解@Configuration配置拦截器。

继承WebMvcConfigurerAdapter。

重写addInterceptors添加需要的拦截器地址。

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

Spring Boot
1、热部署
2、SpringBoot资源文件属性配置
3、SpringBoot资源文件配置server
4、SpringBoot整合模板引擎
5、SpringBoot配置全局的异常捕获
6、SpringBoot整合redis
7、SpringBoot整合定时任务task
8、SpringBoot整合异步任务
9、SpringBoot拦截器的使用
10、springboot指定端口的三种方式

10、springboot指定端口的三种方式

第一:配置文件中添加server.port=9090

第二:在命令行中指定启动端口,比如传入参数一server. port=9000 java -jar bootsample. jar – server.port=9000

第三:传入虚拟机系统属性java - Dserver.port=9000 -jar bootsample.jar