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

springboot+thymeleaf项目本地运行正常,打包部署服务器后访问页面500错误_第1张图片

解决方法:

把"/"去掉

错误:@RequestMapping("/web/main")
错误:return "/web/index";

正确:@RequestMapping("web/main")
正确:return "web/index";

 

 

 

你可能感兴趣的:(springboot,项目错误,Java)