[英]The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved
I searched several other threads on this error, most of them either had the wrong/missing maven dependency or had the wrong uri in their taglib. 我搜索了其他几个关于此错误的线程,其中大多数要么具有错误/缺少的Maven依赖关系,要么其taglib中的uri错误。
As far as I know, I've got everything correct and my app keeps failing once I get to the jsp where I use JSTL. 据我所知,我一切都正确,一旦到达使用JSTL的jsp,我的应用程序就会不断失败。
This is the taglib I'm using: 这是我正在使用的taglib:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
And these are my maven dependencies 这些是我的Maven依赖项
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
As far as I know, from the servlet api 2.4 on you need jstl 1.2, which I have, so I really don't see the problem here... 据我所知,从servlet api 2.4开始,您需要我拥有的jstl 1.2,所以我真的在这里看不到问题...
EDIT: I see this question has been marked as a duplicate, though it isn't. 编辑:我看到这个问题已被标记为重复,尽管不是。 The referring question was solved by fixing the uri of the
taglib
, here it was a case of adding jstl to tomcat's lib folder 通过修复
taglib
的uri解决了引用的问题,这是在Tomcat的lib文件夹中添加jstl的一种情况
I added jstl-1.2.jar
to my tomcat/lib
folder. 我将
jstl-1.2.jar
添加到了tomcat/lib
文件夹中。 As tomcat doesn't have the jstl jar and by putting my scope on provided
I had to make sure my container (tomcat) had the relevant jar available. 由于tomcat没有jstl jar,因此通过
provided
我的作用域,我必须确保我的容器(tomcat)具有相关的jar。
Though I haven't tested it, this should also work by leaving the jstl
jar on the default compile scope 尽管我还没有测试过,但这也应该通过将
jstl
jar保留在默认编译范围内而起作用
Try this one from mvnrepository 从mvnrepository试试这个
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
Read similar post here 在这里阅读类似的帖子
Update the version 更新版本
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
Use : 采用 :
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
</dependency>
javax.servlet
moved to above. javax.servlet
移至上方。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.