@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配置视图
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- springboot 自动配置 主要通过@EnableAutoConfiguration,@Conditional...
- 1. 配置文件简介 spring boot使用一个全局配置文件:application.properties或者a...
- https://blog.csdn.net/forezp/article/details/70341818本文出自...
- 构建springboot项目 开发工具:Spring Tool Suite 创建项目:(略) 修改pom.xml支...