This question already has answers here:
Closed 4 years ago.
I am using a JSP page to print an array of values. I'm trying to use JSTL <c:forEach>
for this.
<c:forEach items="${objects}" var="object">
<td>${object.name} </td>
</c:forEach>
The problem is my JSTL taglib declaration:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
The IDE shows an error on this line
Can not find the tag library descriptor.
Many of the forums point to the old Sun site to download the JSTL libraries. Now all of these links point to the Oracle home page with no link to JSTL binaries. This is leading me to believe there is a newer approach to accomplish this.
Just check our own JSTL wiki page for the proper download links and crystal clear installation instructions.
Put your mouse above the [jstl]
tag which you put on the question yourself until a black box shows up and click therein the info link.
Then scroll a bit down to JSTL versions information until you find download link to JSTL 1.2 (or 1.2.1).
Finally just drop exactly that file in webapp's /WEB-INF/lib
.
This way the taglib declaration must not give any errors anymore and the JSTL tags and functions should just work.
I just want to share my experience. I have same problem about jstl using maven. I resolved it by adding two dependency.
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
If you use Tomcat server I suggest you to put JSTL .jar file to the Tomcat lib folder. By doing this you will have an access to JSTL in all your web projects automatically (with taglib declaration in .jsp files of course).
You can download the Apache Standard Taglib and include the jar in your project.
This is a fix for people who are not using maven. You also need to add standard.jar
to your lib folder for the core tag library to work. Works for jstl version 1.1.
<%@taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core"%>
I was getting this problem with a maven project using the eclipse IDE. I changed the 'Order and Export' in the project's build path putting the Maven dependencies first and the error disappeared. I guess it's because the eclipse IDE was initially building my application source before loading the Maven libraries.
I was getting the same problem on Spring Tool Suite 3.2 and changed the version of jstl to 1.2 (from 1.1.2) manually when adding it to the dependency list, and the error got disappeared.