Code example for WebMvcConfigurationSupport

0
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 
import org.springframework.web.servlet.view.InternalResourceViewResolver; 
 
@Configuration 
@ComponentScan(basePackages = "org.springframework.web.issues", excludeFilters = { @Filter(Configuration.class) }) 
public class WebConfig extends WebMvcConfigurationSupport { 
 
	@Override 
	public void addViewControllers(ViewControllerRegistry registry) { 
		registry.addViewController("/").setViewName("home"); 
	} 
 
	@Bean 
	public InternalResourceViewResolver viewResolver() { 
		InternalResourceViewResolver resolver = new InternalResourceViewResolver(); 
		resolver.setPrefix("/WEB-INF/views/"); 
		resolver.setSuffix(".jsp"); 
		return resolver; 
	}