This repository was archived by the owner on Dec 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
src/main/java/works/weave/socks/orders/config Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change 11package works .weave .socks .orders .config ;
22
3- import org .springframework .beans .factory .annotation .Autowired ;
43import org .springframework .context .annotation .Bean ;
54import 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 ;
86import works .weave .socks .orders .middleware .HTTPMonitoringInterceptor ;
97
108@ Configuration
11- public class WebMvcConfig extends WebMvcConfigurerAdapter {
12- @ Autowired
13- private HTTPMonitoringInterceptor httpMonitoringInterceptor ;
14-
9+ public class WebMvcConfig {
1510 @ Bean
1611 HTTPMonitoringInterceptor httpMonitoringInterceptor () {
1712 return new HTTPMonitoringInterceptor ();
1813 }
1914
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 );
2418 }
2519}
You can’t perform that action at this time.
0 commit comments