This repository was archived by the owner on Dec 5, 2023. It is now read-only.
File tree 1 file changed +5
-11
lines changed
src/main/java/works/weave/socks/shipping/configuration
1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change 1
1
package works .weave .socks .shipping .configuration ;
2
2
3
- import org .springframework .beans .factory .annotation .Autowired ;
4
3
import org .springframework .context .annotation .Bean ;
5
4
import org .springframework .context .annotation .Configuration ;
6
- import org .springframework .web .servlet .config .annotation .InterceptorRegistry ;
7
- import org .springframework .web .servlet .config .annotation .WebMvcConfigurerAdapter ;
5
+ import org .springframework .web .servlet .handler .MappedInterceptor ;
8
6
import works .weave .socks .shipping .middleware .HTTPMonitoringInterceptor ;
9
7
10
8
@ Configuration
11
- public class WebMvcConfig extends WebMvcConfigurerAdapter {
12
- @ Autowired
13
- private HTTPMonitoringInterceptor httpMonitoringInterceptor ;
14
-
9
+ public class WebMvcConfig {
15
10
@ Bean
16
11
HTTPMonitoringInterceptor httpMonitoringInterceptor () {
17
12
return new HTTPMonitoringInterceptor ();
18
13
}
19
14
20
- @ Override
21
- public void addInterceptors (InterceptorRegistry registry ) {
22
- registry .addInterceptor (httpMonitoringInterceptor )
23
- .addPathPatterns ("/**" );
15
+ @ Bean
16
+ public MappedInterceptor myMappedInterceptor (HTTPMonitoringInterceptor interceptor ) {
17
+ return new MappedInterceptor (new String []{"/**" }, interceptor );
24
18
}
25
19
}
You can’t perform that action at this time.
0 commit comments