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

Posted 栗霖

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了异常:This application has no explicit mapping for /error, so you are seeing this as a fallback.相关的知识,希望对你有一定的参考价值。

出现这个异常说明了跳转页面的url无对应的值.

原因1:

Application启动类的位置不对.要将Application类放在最外侧,即包含所有子包 
原因:spring-boot会自动加载启动类所在包下及其子包下的所有组件.

原因2:

在springboot的配置文件:application.yml或application.properties中关于视图解析器的配置问题: 
当pom文件下的spring-boot-starter-paren版本高时使用: 
spring.mvc.view.prefix/spring.mvc.view.suffix 
当pom文件下的spring-boot-starter-paren版本低时使用: 
spring.view.prefix/spring.view.suffix

原因3:

控制器的URL路径书写问题 
@RequestMapping(“xxxxxxxxxxxxxx”) 
实际访问的路径与”xxx”不符合.








以上是关于异常:This application has no explicit mapping for /error, so you are seeing this as a fallback.的主要内容,如果未能解决你的问题,请参考以下文章

Tomcat - this web application instance has been stopped already

This application has no explicit mapping for 解决方法

This application has no explicit mapping for 解决方法

this web application instance has been stopped already

解决Springboot:This application has no explicit mapping for /error

关于tomcat启动报“this web application instance has been stopped already”的处理