Spring boot JSP访问页面显示Whitelabel Error Page
来源:互联网 发布:红色复仇扫矿软件 编辑:程序博客网 时间:2024/06/05 16:16
访问页面如下
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing
this as a fallback.Tue Apr 21 23:16:00 EEST 2015 There was an unexpected error (type=Not
Found, status=404). No message available
网上排错方案如下:
1.检查Application启动类位置是否和所有子包同级
很像是没有读到你要访问的地址。
原因是【Application启动类放的位置不对】要将Application放在最外层,也就是要包含所有子包。
比如你的groupId是com.google,子包就是所谓的com.google.xxx,所以要将Application放在com.google包下。
请参考以下结论:spring-boot会自动加载启动类所在包下及其子包下的所有组件.
2.检查application.properties配置文件中视图路径配置项
找了一晚上,居然发现是某个配置出错了! spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp应该改为 spring.view.prefix=/WEB-INF/jsp/
spring.view.suffix=.jsp。 这充分体现了spring的默认大于配置理念
以上方案都没有解决问题
最后在staroverflow找到解决方案
Ensure that you have jasper and jstl in the list of dependencies:
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
The Answerer is @Biju Kunjummen
在pom.xml文件中配置jsp和jstl依赖后运行成功
- Spring boot JSP访问页面显示Whitelabel Error Page
- spring-boot jsp whitelabel error page问题解决
- Spring Boot自定义错误页面,Whitelabel Error Page处理方式
- Spring Boot自定义错误页面,Whitelabel Error Page处理方式
- Spring Boot自定义错误页面,Whitelabel Error Page处理方式
- spring boot: Whitelabel Error Page的解决方案
- spring boot: Whitelabel Error Page的解决方案
- spring boot: Whitelabel Error Page的解决方案
- Spring-Boot "Whitelabel Error Page" 解决方法总结
- Spring Boot报错Whitelabel Error Page
- Spring Boot报错Whitelabel Error Page
- spring boot初学hello world访问templates报Whitelabel Error Page 404
- Spring Boot框架Whitelabel Error Page SpEL注入漏洞分析
- Spring Boot 第一个HelloWorld程序 whitelabel Error Page
- 13.2 Spring Boot启动报错:Whitelabel Error Page
- 13.2 Spring Boot启动报错:Whitelabel Error Page
- 初学Spring Boot遇到Whitelabel Error Page的解决办法
- spring boot整合freemarker出现Whitelabel Error Page问题
- 另类的菱形输出
- 聚类
- set和map
- 阿里云全球首发云骨干网
- 切片(slice)
- Spring boot JSP访问页面显示Whitelabel Error Page
- 微信单挑三大运营商,继短信垄断之后,电话革命战已打响
- 有关软件开发的概念
- 输入n个数输出他们的平均数以-1为结束标志
- 美团刚做起网约车,滴滴就送外卖?你们倒真是相爱相杀
- 记一次webSphere安装部署发布不全原因分析
- 阿里云linux服务器安装桌面
- 关于java中的匿名内部类
- 23 岁谷歌女工程师浮尸湾区水面,死因不明,警方仍在调查