一、异常描述
通过apache的ServletFileUpload进行文件上传时,对于的列表页<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>标红显示错误提示,运行访问时后台报"org.apache.jasper.JasperException: 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"异常错误,详情如下>>
严重: Servlet.service() for servlet [jsp] in context with path [/FileService] threw exception [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] with root cause@b@org.apache.jasper.JasperException: 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@b@ at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)@b@ at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)@b@ at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:117)@b@ at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:325)@b@ at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:154)@b@ at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)@b@ at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)@b@ at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1427)@b@ at org.apache.jasper.compiler.Parser.parse(Parser.java:138)@b@ at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)@b@ at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)@b@ at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)@b@ at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)@b@ at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)@b@ at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)@b@ at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)@b@ at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)@b@ at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)@b@ at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)@b@ at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)@b@ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)@b@ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)@b@ at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)@b@ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)@b@ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)@b@ at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)@b@ at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)@b@ at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)@b@ at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)@b@ at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)@b@ at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)@b@ at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)@b@ at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)@b@ at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)@b@ at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)@b@ at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1720)@b@ at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1679)@b@ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)@b@ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)@b@ at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)@b@ at java.lang.Thread.run(Thread.java:745)
二、解决方法
因为缺少jstl依赖包(jstl-1.2.jar.zip包)导致错误,在项目中下载引入,即可解决问题了(完整项目源码及依赖包参见资源下载页)