Can not find the tag library descriptor for http //java.sun.com/jsp/jstl/core


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:



  • Our JSTL wiki page (you can reach there by hovering the mouse on jstl and clicking info link)

  • How to install JSTL? The absolute uri: http://java.sun.com/jstl/core cannot be resolved


Use taglib definition in your JSP or better include it in every page by the first line.

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

There's also fix jstl-1.2 dependency in your project. Also use servlet specification at least 2.4 in your web.xml.

The maven dependencies are (maven is a open source development tool)

<dependency>
  <groupId>jstl</groupId>
  <artifactId>jstl</artifactId>
  <version>1.2</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>taglibs</groupId>
  <artifactId>standard</artifactId>
  <version>1.1.2</version>
  <scope>compile</scope>
</dependency>

In the web.xml start writing

<?xml version="1.0" encoding="UTF-8"?>
<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">

EDIT:

I'd like to add a note that @informatik01 has mentioned in the comment about newer version of JSTL libraries available from Maven repository: JSTL version 1.2.1.

转载:http://stackoverflow.com/questions/15434817/can-not-find-the-tag-library-descriptor-for-http-java-sun-com-jsp-jstl-core

Can not find the tag library descriptor for http:java.sun.comjspjstlcore

Questions : Can not find the tag library descriptor for http:java.sun.comjspjstlcore

2022-09-15T04:32:46+00:00 2022-09-15T04:32:46+00:00

741

I'm trying to use JSTL, but I get the anycodings_jstl following error:

Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"

How is this caused and how can I solve it?

Total Answers 8

33

Answers 1 : of Can not find the tag library descriptor for http:java.sun.comjspjstlcore

Use taglib definition in your JSP or anycodings_java better include it in every page by the anycodings_java first line.

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

There's also fix jstl-1.2 dependency in anycodings_java your project. Also use servlet anycodings_java specification at least 2.4 in your anycodings_java web.xml.

The maven dependencies are (maven is a anycodings_java open source development tool)

<dependency>
  <groupId>jstl</groupId>
  <artifactId>jstl</artifactId>
  <version>1.2</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>taglibs</groupId>
  <artifactId>standard</artifactId>
  <version>1.1.2</version>
  <scope>compile</scope>
</dependency>

In the web.xml start writing

<?xml version="1.0" encoding="UTF-8"?>
<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">

EDIT:

I'd like to add a note that anycodings_java @informatik01 has mentioned in the anycodings_java comment about newer version of JSTL anycodings_java libraries available from Maven anycodings_java repository: JSTL version 1.2.1 API and anycodings_java JSTL 1.2.1 .

0

2022-09-15T04:32:46+00:00 2022-09-15T04:32:46+00:00Answer Link

mRahman

3

Answers 2 : of Can not find the tag library descriptor for http:java.sun.comjspjstlcore

I had the same problem even after I anycodings_java added jar files for jstl and standard. anycodings_java For me, it resolved after I added a anycodings_java Targeted runtime for my project.

Go to Project Properties > Targeted anycodings_java Runtimes and select the server you are anycodings_java using (Tomcat 7.0 for me).

0

2022-09-15T04:32:46+00:00 2022-09-15T04:32:46+00:00Answer Link

joy

3

Answers 3 : of Can not find the tag library descriptor for http:java.sun.comjspjstlcore

create a libs folder in the inside anycodings_java WEB-INF directory and add jstl, standard anycodings_java jars as below.

0

2022-09-15T04:32:46+00:00 2022-09-15T04:32:46+00:00Answer Link

jidam

6

Answers 4 : of Can not find the tag library descriptor for http:java.sun.comjspjstlcore

You may try to make the folder which anycodings_java include jsp-s become the source folder anycodings_java of eclipse, that solved the same problem anycodings_java of mine. As below:

  1. open project's properties.(right click project, then choose the Properties)
  2. choose Java Build Path, select the Source tab, click Add Folder and choose the folder including your jsp-s, OK

0

2022-09-15T04:32:46+00:00 2022-09-15T04:32:46+00:00Answer Link

joy

2

Answers 5 : of Can not find the tag library descriptor for http:java.sun.comjspjstlcore

in your pom.xml just add

    <!-- jstl -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency> 

and try run

mvn eclipse:eclipse -Dwtpversion=2.0

will solve the problem

0

2022-09-15T04:32:46+00:00 2022-09-15T04:32:46+00:00Answer Link

jidam

5

Answers 6 : of Can not find the tag library descriptor for http:java.sun.comjspjstlcore

You just need to include the anycodings_java standard.jar file in your project build anycodings_java path.

0

2022-09-15T04:32:46+00:00 2022-09-15T04:32:46+00:00Answer Link

jidam

5

Answers 7 : of Can not find the tag library descriptor for http:java.sun.comjspjstlcore

I have similar issue, why should we add anycodings_java external jar files when we are using anycodings_java maven?

I have already included jstl maven anycodings_java dependency then also I encounter error anycodings_java "Can not find the tag library descriptor anycodings_java for anycodings_java "http://java.sun.com/jsp/jstl/core"". anycodings_java Then I include following dependency anycodings_java then error get solve, without including anycodings_java any single external jar file.

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
</dependency>

0

2022-09-15T04:32:46+00:00 2022-09-15T04:32:46+00:00Answer Link

jidam

3

Answers 8 : of Can not find the tag library descriptor for http:java.sun.comjspjstlcore

As per snapshot the main reason for anycodings_java error is that you are not defining c.tld anycodings_java in lib folder causes such error.

This lib content information about anycodings_java taglib

0

2022-09-15T04:32:46+00:00 2022-09-15T04:32:46+00:00Answer Link

jidam

Can not find the tag library descriptor for tags?

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 the project's Build Path.

How do I create a tag library descriptor in eclipse?

Writing the Tag Library Descriptor.
Create a text file with an appropriate name and the extension . ... .
Add the contents of the TLD, embedded in a <taglib> element, as indicated in steps 4-7. ... .
Identify the tag library: <tlib-version>version_number</tlib-version> ... .
Define a tag library validator (Optional). ... .
Define a tag..

How install TLD file in eclipse?

Just go for New->XML file and name the file as yourname. tld thats all !

What JAR files are required for JSTL tags?

JSTL 1.1 requires a JSP 2.0 container. We recommend you test the Standard Taglib with Tomcat 5. x. JSTL 1.0 only required a JSP 1.2 container and is also available for download from Jakarta Taglibs. ... Getting started quickly..