項目背景:springboot+thymeleaf
本地運行正常,打包部署服務器後訪問頁面500錯誤
接口正常
報錯頁面如下:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Jan 13 18:58:14 CST 2020
There was an unexpected error (type=Internal Server Error, status=500).
Error resolving template [/web/plant/index], template might not exist or might not be accessible by any of the configured Template Resolvers
解決方法:
把"/"去掉
錯誤:@RequestMapping("/web/main")
錯誤:return "/web/index";
正確:@RequestMapping("web/main")
正確:return "web/index";