Install JSTL Library Step 1 − Download the binary distribution from Apache Standard Taglib and unpack the compressed file. Step 2 − To use the Standard Taglib from its Jakarta Taglibs distribution, simply copy the JAR files in the distribution's 'lib' directory to your application's webapps\ROOT\WEB-INF\lib directory.
Just go for New->XML file and name the file as yourname. tld thats all !
Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”
Based on one of your previous questions you're using Tomcat 7. In that case you need JSTL 1.2. However, you've there a jstl.jar
file while JSTL 1.2 has clearly the version number included like so jstl-1.2.jar
. The sole filename jstl.jar
is typical for JSTL 1.0 and 1.1. This version requires a standard.jar
along in /WEB-INF/lib
which contains the necessary TLD files. However, in your particular case the standard.jar
is clearly missing in /WEB-INF/lib
and that's exactly the reason why the taglib URI couldn't be resolved.
To solve this you must remove the wrong JAR file, download jstl-1.2.jar and drop it in its entirety in /WEB-INF/lib
. That's all. You do not need to extract it nor to fiddle in project's Build Path.
Don't forget to remove that loose c.tld
file too. It absolutely doesn't belong there. This is indeed instructed in some poor tutorials or answers elsewhere in the Internet. This is a myth caused by a major misunderstanding and misconfiguration. There is never a need to have a loose JSTL TLD file in the classpath, also not in previous JSTL versions.
In case you're using Maven, use the below coordinate:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
You should also make sure that your web.xml
is declared conform at least Servlet 2.4 and thus not as Servlet 2.3 or older. Otherwise EL expressions inside JSTL tags would in turn fail to work. Pick the highest version matching your target container and make sure that you don't have a <!DOCTYPE>
anywhere in your web.xml
. Here's a Servlet 3.0 (Tomcat 7) compatible example:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
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_3_0.xsd"
version="3.0">
<!-- Config here. -->
</web-app>
###See also:
I had same problem and despite having jstl
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
I had to add 'standard' as well:
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
Also, as mentioned in previous post:
The URI depends on the version of JSTL you are using. For Version 1.0 use:
http://java.sun.com/jstl/core
and for 1.1 (and later), you need to use:
http://java.sun.com/jsp/jstl/core
If you are using maven your pom's <dependencies>
tag should look like:
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>javax.servlet.jsp.jstl-api</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>
It works for me.
Downloading jstl-1.2.jar instead of jstl.jar solves the problem
This works as well:
<dependency>
<scope>compile</scope>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
so used jstl 1.2 instead of standard.jar together with jstl-api 1.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With