> 文档中心 > This application has no explicit mapping for /error, so you are seeing this as a fallback.

This application has no explicit mapping for /error, so you are seeing this as a fallback.


问题描述

springboot项目在编辑器中启动,各项功能都正常,今天打成jar包之后,在命令运行时,点击按钮,浏览器报错如下:

这里是引用

查询资料

1、方面上面@Request(“xxx”)中,访问时候与xxx名不一致导致(不可能,因为编辑器状态下项目正常)
2、application中增加配置如下:(无用)

spring.mvc.static-path-pattern=**/

3、controller类上面注解@controller替换,或者方法上加@ResponseBody(不合适,原因:此处需要返回页面,而不是具体对象)
4、项目中启动类和controller目录包含问题,如下:(对我无效)
在这里插入图片描述

解决方法

经过检查,在所有需要返回页面的方法中,返回页面的时候都是:return "/system/main"改成return "system/main"即去掉最前面的"/",问题解决!