springboot+thymeleaf項目本地運行正常,打包部署服務器後訪問頁面500錯誤

項目背景: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";

 

 

 

發佈了57 篇原創文章 · 獲贊 35 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章