SpringBoot配置视图

作者: Chinesszz | 来源:发表于2017-02-08 11:41 被阅读41次
@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;
    }
}

相关文章

网友评论

    本文标题:SpringBoot配置视图

    本文链接:https://www.haomeiwen.com/subject/mhpvittx.html