File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,15 @@ flylib-boot是针对springboot构建的程序的基础框架,专门用于构
4
4
5
5
## 功能
6
6
包含一个Spring Boot的一些常见的基础组件的设置
7
- 1 . 针对Handler的全局的异常处理(处理所有Controller里的Handler里抛出的异常)
7
+ ** 1. 针对Handler的全局的异常处理(处理所有Controller里的Handler里抛出的异常)
8
8
2 . Filter
9
- 3 . Interceptor
9
+ 3 . Interceptor**
10
10
11
11
注意:SpringBoot(SpringMVC)里的Handler特指@Controller 注解的类里的每个处理HTTP请求的一个public method.
12
12
13
13
## 使用方法
14
- 在自己的项目中添加flylib-boot-starter的maven依赖
14
+ - Step 1: 进入目录flylib-boot-starter,执行<code >mvn install</code >
15
+ - Step 2: 在自己的项目中添加flylib-boot-starter的maven依赖. 并留意自己使用的spring-boot版本,去修改自己的pom.xml文件
15
16
```
16
17
<dependency>
17
18
<groupId>org.flylib</groupId>
@@ -74,7 +75,7 @@ flylib-boot是针对springboot构建的程序的基础框架,专门用于构
74
75
75
76
```
76
77
77
- 捕获异常的实例.
78
+ - Step 3: 在自己的程序中new 一个UserException(自定义的异常类)设置捕获异常
78
79
```
79
80
@RequestMapping("")
80
81
public String index() throws RuntimeException {
@@ -84,6 +85,7 @@ flylib-boot是针对springboot构建的程序的基础框架,专门用于构
84
85
throw userException;
85
86
}
86
87
```
88
+ - Step 4: 运行自己的Spring Boot项目
87
89
输出到浏览器的结果
88
90
```
89
91
{
You can’t perform that action at this time.
0 commit comments