Implemented an interceptor, that forbiddes access according to a header
[demos/spring-boot] / src / main / java / de / juplo / demo / DemoWebMvcConfigurer.java
1 package de.juplo.demo;
2
3 import org.springframework.beans.factory.annotation.Autowired;
4 import org.springframework.context.annotation.Configuration;
5 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
6 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
7
8
9 @Configuration
10 public class DemoWebMvcConfigurer implements WebMvcConfigurer
11 {
12   @Autowired
13   RequestTypeInterceptor requestTypeInterceptor;
14
15
16   @Override
17   public void addInterceptors(InterceptorRegistry registry)
18   {
19     registry.addInterceptor(requestTypeInterceptor);
20   }
21 }