1 package de.juplo.yourshouter;
5 import javax.inject.Inject;
7 import org.springframework.context.annotation.Configuration;
8 import org.springframework.social.connect.UsersConnectionRepository;
9 import org.springframework.web.servlet.config.annotation.EnableWebMvc;
10 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
11 import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
12 import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
16 * Spring MVC Configuration.
22 public class WebMvcConfig extends WebMvcConfigurerAdapter
25 private UsersConnectionRepository usersConnectionRepository;
29 * Configure the {@link UserCookieInterceptor} to intercept all requests.
32 * The {@link InterceptorRegistry} to use.
34 * @see {@link UserCookieInterceptor}
37 public void addInterceptors(InterceptorRegistry registry)
39 registry.addInterceptor(new UserCookieInterceptor(usersConnectionRepository));
46 public void addViewControllers(ViewControllerRegistry registry)
48 // Configure the view /thymeleaf/signin.html for the path /signin.html
49 registry.addViewController("/signin.html");