两种方案
1.application.properties中增加该配置
spring.resources.static-locations=classpath:/templates/,classpath:/static
虽然默认是去templates下找,
最好明确指明先去tempplates文件夹下匹配html,然后再去statics下
2.把启动类放在最外层
SpringBoot默认会扫描启动类所在的包及其子包。
启动类是注解@SpringBootApplication标注的类,也就是要确定@Controller能被扫描到
相关文章
- 12-18VS2010 win7 64位安装后新建项目生成时错误:LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
- 12-18ERROR: Cannot uninstall 'chardet'. It is a distutils installed project and thus we cannot
- 12-18CocoaPod升级(以及ERROR: While executing gem ... (Errno::EPERM)解决办法)
- 12-18android.view.InflateException Error inflating class android.webkit.WebView
- 12-18软件测试第二次作业——Fault,Failure,Error辨析与设计测试用例
- 12-18Syntax Error: Error: PostCSS received undefined instead of CSS string
- 12-18LA5009 Error Curves
- 12-18QT遇到error: msvc-version.conf loaded but QMAKE_MSC_VER isn't set
- 12-18QT error:msvc-version.conf loaded but QMAKE_MSC_VER isn't set
- 12-18Python3 pip命令报错:Fatal error in launcher: Unable to create process using '"'