项目是使用Springboot 构建的spring+springMVC+mybatis 程序,后台管理页面使用的是JSP作为显示层。在jsp页面中使用了各种标签。
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib prefix='sec' uri='http://www.springframework.org/security/tags' %>
本来是正常的但是引入了百度的SDK后,页面就报错了。
compile('com.baidubce:bce-java-sdk:0.10.133') {
transitive = false
exclude group: 'ch.qos.logback', module: 'logback-core'
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'org.slf4j', module: 'slf4j-api'
exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl'
exclude group: 'org.apache.logging.log4j', module: 'log4j-to-slf4j'
exclude group: 'org.slf4j', module: 'jul-to-slf4j'
}
报错的情况如下:
jsp页面报错
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Oct 22 11:57:24 CST 2020
There was an unexpected error (type=Internal Server Error, status=500).
/WEB-INF/static/jsp/login/index.jsp (line: [2], column: [0]) The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
后台报错
2020-10-22 11:57:24.392 http-nio-8087-exec-1 ERROR [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[jsp]] - Servlet.service() for servlet [jsp] threw exception
org.apache.jasper.JasperException: /WEB-INF/static/jsp/login/index.jsp (line: [2], column: [0]) The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42) ~[tomcat-embed-jasper-9.0.19.jar:9.0.19]
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:292) ~[tomcat-embed-jasper-9.0.19.jar:9.0.19]
看起来好像是C标签报错,但是把C标签注释掉后,下一个标签继续报错,知道把全部的标签注释了导致页面其他地方错误。
参考了:cannot be resolved in either web.xml or the jar files deployed with this application 还是不行。
目前无解,将百度的SDK(com.baidubce:bce-java-sdk:0.10.133)注释掉后系统正常。一旦添加就马上报错。
springboot 使用JSP目前属于比较老的技术了。能查询到的决绝方法不多,还在找方法解决。
……………………………………绝望的分割线……………………………………
找了很久没找到,后来…………调整了运行参数就正常的。