X-Git-Url: https://juplo.de/gitweb/?p=examples%2Ffacebook-app;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Fyourshouter%2FWebMvcConfig.java;fp=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Fyourshouter%2FWebMvcConfig.java;h=e5c6d6f5bb7a3ea045bbf74d87c72ec20516f8b4;hp=0000000000000000000000000000000000000000;hb=02f599692669d48f9865764fda994ad61d203ffb;hpb=931f5c9b9a43acb81775e995a613bd0c5b8aab52 diff --git a/src/main/java/de/juplo/yourshouter/WebMvcConfig.java b/src/main/java/de/juplo/yourshouter/WebMvcConfig.java new file mode 100644 index 0000000..e5c6d6f --- /dev/null +++ b/src/main/java/de/juplo/yourshouter/WebMvcConfig.java @@ -0,0 +1,40 @@ +package de.juplo.yourshouter; + + + +import javax.inject.Inject; + +import org.springframework.context.annotation.Configuration; +import org.springframework.social.connect.UsersConnectionRepository; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + + +/** + * Spring MVC Configuration. + * + * @author Kai Moritz + */ +@Configuration +@EnableWebMvc +public class WebMvcConfig extends WebMvcConfigurerAdapter +{ + @Inject + private UsersConnectionRepository usersConnectionRepository; + + + /** + * Configure the {@link UserCookieInterceptor} to intercept all requests. + * + * @param registry + * The {@link InterceptorRegistry} to use. + * + * @see {@link UserCookieInterceptor} + */ + @Override + public void addInterceptors(InterceptorRegistry registry) + { + registry.addInterceptor(new UserCookieInterceptor(usersConnectionRepository)); + } +}