Spring Boot实践记录

SpringBoot配置视图

2017-02-08  本文已影响41人  Chinesszz
@Configuration
@EnableWebMvc
public class ApplicationConfigurerAdapter extends WebMvcConfigurerAdapter {

    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }

    @Bean
    public InternalResourceViewResolver viewResolver() {
        InternalResourceViewResolver resolver = new InternalResourceViewResolver();
        resolver.setPrefix("WEB-INF/html");
        resolver.setSuffix(".html");
        return resolver;
    }
}
上一篇下一篇

猜你喜欢

热点阅读