File tree 2 files changed +12
-5
lines changed
src/main/java/com/codingapi/springboot/framework
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 26
26
<artifactId >spring-tx</artifactId >
27
27
</dependency >
28
28
29
- <dependency >
30
- <groupId >org.springframework</groupId >
31
- <artifactId >spring-web</artifactId >
32
- </dependency >
33
-
34
29
<dependency >
35
30
<groupId >com.alibaba</groupId >
36
31
<artifactId >fastjson</artifactId >
59
54
<dependency >
60
55
<groupId >org.springframework</groupId >
61
56
<artifactId >spring-webmvc</artifactId >
57
+ <scope >provided</scope >
58
+ </dependency >
59
+
60
+ <dependency >
61
+ <groupId >org.springframework</groupId >
62
+ <artifactId >spring-web</artifactId >
63
+ <scope >provided</scope >
62
64
</dependency >
63
65
64
66
<dependency >
Original file line number Diff line number Diff line change 1
1
package com .codingapi .springboot .framework ;
2
2
3
3
import com .codingapi .springboot .framework .servlet .ServletExceptionHandler ;
4
+ import org .springframework .boot .autoconfigure .condition .ConditionalOnClass ;
4
5
import org .springframework .context .annotation .Bean ;
5
6
import org .springframework .context .annotation .Configuration ;
6
7
import org .springframework .web .servlet .HandlerExceptionResolver ;
8
+ import org .springframework .web .servlet .ModelAndView ;
9
+ import org .springframework .web .servlet .view .json .MappingJackson2JsonView ;
10
+
7
11
8
12
@ Configuration
9
13
public class AutoConfiguration {
10
14
11
15
@ Bean
16
+ @ ConditionalOnClass (value = {HandlerExceptionResolver .class , ModelAndView .class , MappingJackson2JsonView .class })
12
17
public HandlerExceptionResolver servletExceptionHandler () {
13
18
return new ServletExceptionHandler ();
14
19
}
You can’t perform that action at this time.
0 commit comments