Code example for WebMvcConfigurationSupport

0
@Configuration 
@EnableWebMvc 
@ComponentScan(basePackages = "com.sishuok.mvc", useDefaultFilters = false, includeFilters = { 
        @ComponentScan.Filter(type = FilterType.ANNOTATION, value = {Controller.class}) 
}) 
public class MvcConfig extends WebMvcConfigurationSupport { 
 
    @Bean 
    public ViewResolver viewResolver() { 
        InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); 
        viewResolver.setPrefix("/WEB-INF/jsp/"); 
        viewResolver.setSuffix(".jsp"); 
        return viewResolver; 
    } 
 
    @Override 
    protected void addResourceHandlers(ResourceHandlerRegistry registry) { 
        registry.addResourceHandler("/static/**").addResourceLocations("/WEB-INF/static/"); 
    } 
}