[java] How to resolve : Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.library.controller.*"%>
<%@ page import="com.library.dao.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.util.Date" %>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Return Page</title>
</head>
<body bgcolor="#aabcde">
<div align="right"><a href="Login.jsp">Logout</a></div>
<table align="center" border="2" cellspacing="3" cellpadding="3">
<tr><th>BookID</th><th>BookName</th><th>Issuedate</th><th>returndate</th></tr>
<c:forEach var="element" items="${list}">
    <tr>
        <td>${element.getBookid}</td><td>${element.getBookname()}</td>  
        <td>${element.getIssuedate()}</td><td>${element.getReturndate()}</td>
    </tr>
</c:forEach>

The Eclipse IDE is showing red underline and when I focus it the tag is : can not find the library descriptor for http://java.sun.com/jsp/jstl/core

This question is related to java jsp jstl

The answer is


As @ace mentioned you will need the jstl.jar in your project, so if you are using maven, you could add this dependency:

<dependency>
    <groupId>jstl</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>

Source: http://mvnrepository.com/artifact/jstl/jstl/

Hope it helps.

EDIT: Most of servers already have this dependency, if you add it using maven it may cause version conflicts (like Method/ClassNotFoundException) if you don't configure the server well, so it's better set a target server for your project, as @willix mentioned.


paste below two jar in your /WEB-INF/lib folder and then go to project properties and go to add jar and select these two jars then click Ok, Ok

standard.jar, jstl-1.0.2.jar


I will throw one more solution into the mix. I downloaded a sample app and it was crimping only on this taglib. Turns out it didn't care for the single quotes around the attributes.

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

Once I changed those and made sure jstl.jar was in the web app, i was good to go.


I tried "validating" de *.jsp and *.xml files in eclipse with the validate tool.

"right click on directory/file ->- validate" and it worked!

Using eclipse juno.

Hope it helps!


Add both javax.servlet.jsp.jstl-api-1.2.1.jar and standard-1.1.2.jar


You have to write as

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

Make sure you have jstl-1.0 & standard.jar BOTH files are placed in a classpath


You are probably targeting a server without built-in JSTL support (e.g. some version of Tomcat.) You will need to provision your own JSTL tag library.


I added jstl jar in a library and added it to build path and deployment assembly but it dint worked. then i simply copied my jstl jar into lib folder inside webcontent, it worked. in eclipse lib folder in included to deployment assembly by default


I know this thread is a year old now but having experienced the same problem I managed to solve the problem by setting a target server for my project.

i.e. right-click on your project and select 'Properties' -> 'Targeted Runtimes' and select the server you going to run your web app on (Tomcat 6 or 7).


Using the:

standard.jar

Resolves the problem.


After a couple of hit and trial I use this. This works for me.

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

WARNING: As BalusC correctly mentioned, this works for JSTL 1.0.


This should work

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

and moreover please let us know why are you importing all these class

<%@ page import="com.library.controller.*"%> 
<%@ page import="com.library.dao.*" %> 
<%@ page import="java.util.*" %> 
<%@ page import="java.lang.*" %> 
<%@ page import="java.util.Date" %>

We don't need to include java.lang as it is the default package.


I solved this issue. use below taglib

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

and add jstl-1.2.jar


It has nothing to do about <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>.

Just go to project and right click then project menu -> Clean the project error will definitely remove and update maven .


It will work perfectly when you will place the two required jar files under /WEB-INF/lib folder i.e. jstl-1.2.jar and javax.servlet.jsp under /WEB-INF/lib folder.

Hope it helps. :)


Try to add like this:

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

instead of having

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

Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to jsp

Difference between request.getSession() and request.getSession(true) A child container failed during start java.util.concurrent.ExecutionException The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path Using if-else in JSP Passing parameters from jsp to Spring Controller method how to fix Cannot call sendRedirect() after the response has been committed? How to include js and CSS in JSP with spring MVC How to create an alert message in jsp page after submit process is complete getting error HTTP Status 405 - HTTP method GET is not supported by this URL but not used `get` ever? How to pass the values from one jsp page to another jsp without submit button?

Examples related to jstl

Iterating through a List Object in JSP How to get a index value from foreach loop in jstl Get value from hashmap based on key to JSTL How to use if, else condition in jsf to display image Selected value for JSP drop down using JSTL Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config Adding external resources (CSS/JavaScript/images etc) in JSP Sun JSTL taglib declaration fails with "Can not find the tag library descriptor" How to do if-else in Thymeleaf?