The Spring MVC configuration
The Spring MVC framework can be configured with XML files or Java configuration classes. We will configure our application using Spring MVC configuration classes, the first being the WebAppConfig
class:
package com.gieman.tttracker.web; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @EnableWebMvc @Configuration @ComponentScan("com.gieman.tttracker.web") public class WebAppConfig extends WebMvcConfigurerAdapter { @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new UserInSessionInterceptor()) .addPathPatterns(new String[]{ "/**" }).excludePathPatterns...