others - 在 web.xml 或者 jar 文件中,使用应用程序部署,JSTL: 绝对网址: http://java.sun.com/jsp/jstl/core 不能被解析

在试图访问jsp时,我接收到了异常(使用tomcat 7.0.52 ),


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
 org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
 org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)
 org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:117)
 org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:325)
 org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:154)
 org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
 org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
 org.apache.jasper.compiler.Parser.parseElements(Parser.java:1427)
 org.apache.jasper.compiler.Parser.parse(Parser.java:138)
 org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
 org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
 org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
 org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
 org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
 org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264)
 org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
 org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
 org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
 org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)
 org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
 org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

在我的JSP里


<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

在我的网络XML中


<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

在我的Maven POM中


<dependency>
 <groupId>javax.servlet</groupId>
 <artifactId>servlet-api</artifactId>
 <version>2.5</version>
 <scope>provided</scope>
</dependency>
<dependency>
 <groupId>javax.servlet</groupId>
 <artifactId>jstl</artifactId>
 <version>1.2</version>
 <scope>provided</scope>
</dependency>

我不确定为什么服务器停止并重新发布,它似乎不能工作。

时间:

一个接一个试试

1将它们添加到你的POM xml并删除jstl ,保存POM并右键单击项目Maven > >更新


<!-- Servlet -->
<dependency>
 <groupId>javax.servlet</groupId>
 <artifactId>servlet-api</artifactId>
 <version>2.5</version>
 <scope>provided</scope>
</dependency>
<dependency>
 <groupId>javax.servlet.jsp</groupId>
 <artifactId>jsp-api</artifactId>
 <version>2.1</version>
 <scope>provided</scope>
</dependency>
<dependency>
 <groupId>javax.servlet</groupId>
 <artifactId>jstl</artifactId>
 <version>1.2</version>
</dependency>

2. 删除你的库中的jstl lib 。

servlet-api.jar ,jsp-api.jar

...