SpringBoot返回静态页面

application.properties中加入如下配置:

#视图映射  
#设置srpingboot使用非严格模式解析模板  
spring.thymeleaf.mode=HTML  
spring.resources.static-locations=classpath:/templates/ 

静态页面放在如下位置:

在java中使用WebMvcConfigurerAdapter返回页面:

参考:https://www.jianshu.com/p/a9e6edd46e98

posted @ 2019-08-09 15:54  Dream's  阅读(1111)  评论(0编辑  收藏  举报