《Springboot极简教程》问题解决:Springboot启动报错 Whitelabel Error Page: This application has no explicit mapping for
2017-09-13 14:26
931 查看
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Tue Mar 28 22:25:43 CST 2017 There was an unexpected error (type=Internal Server Error, status=500). Circular view path [login]: would dispatch back to the current handler URL [/login] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
首先,这个出错页面是SpringBoot的一个默认出错页面。源码在:org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration 第151行。
这种错误一般是配置错误,或者MVC报错引起的错误。
比如说,在newer versions of Spring, following needs to be put in application.properties file:
spring.mvc.view.prefix=/WEB-INF/jsp/ spring.mvc.view.suffix=.jsp
Also, JSP files need to be put under src/main/resources/META-INF/resources/WEB-INF/jsp
推荐直接使用java代码配置的方式,这样方便看代码:
package com.restfiddle.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** * Created by jack on 2017/3/28. * * @author jack * @date 2017/03/28 */ @Configuration public class WebMvcConfig extends WebMvcConfigurerAdapter { @Override public void configureViewResolvers(ViewResolverRegistry registry) { //spring.view.prefix=/WEB-INF/jsp/ //spring.view.suffix=.jsp registry.jsp("/WEB-INF/jsp/", ".jsp"); //registry.freeMarker(); //registry.velocity(); //registry.groovy(); } }
问题参考:
http://stackoverflow.com/questions/27113452/circular-view-path-in-a-simple-spring-boot-project-with-a-controller
相关文章推荐
- 《Springboot极简教程》问题解决:Springboot启动报错 Whitelabel Error Page: This application has no explicit mapping for(转)
- 搭建Spring Boot框架 Whitelabel Error Page This application has no explicit mapping for /error, so you ar
- Spring Whitelabel Error Page: This application has no explicit mapping for /error, so you are seeing
- spring-boot启动报错【This application has no explicit mapping for /error.....】
- Springboot启动后报错【This application has no explicit mapping for /error, so you are seeing this as a fallback····】
- spring-boot启动报错【This application has no explicit mapping for /error.....】
- spring-boot启动报错【This application has no explicit mapping for /error.....】
- Spring Boot 报错Wihtelabel Error Page:This application has no explicit mapping for /error 解决办法
- spring-boot启动报错【This application has no explicit mapping for /error.....】
- spring-boot启动报错【This application has no explicit mapping for /error.....】
- SpringBoot启动报错【This application has no explicit mapping for /error.....】
- spring-boot启动报错【This application has no explicit mapping for /error.....】
- spring-boot启动报错:This application has no explicit mapping for /error, so you are seeing this as a fal
- SpringBoot报错:Whitelabel Error Page This application has no explicit mapping for /error, so you are s
- Idea - Spring Boot - MVC 出现This application has no explicit mapping for /error, so you are seeing th
- Springboot应用静态资源不能访问,报“This application has no explicit mapping for /error”
- SpringBoot启动报错【This application has no explicit mapping for /error.....】
- SpringBoot启动报错【This application has no explicit mapping for /error】
- 异常: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.