I\'ve been trying for longer than I\'d like to admit to get JSTL working under Eclipse (and ultimately under GAE/J). I\'ve downloaded Eclipse, the Google App Engine Extension f
Add taglibs-standard-impl-1.2.5 from Apache to the build path of the project. This may resolve the issue.
Ensure that your web.xml
root declaration complies at least Servlet 2.4.
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!-- Config here. -->
</web-app>
Or if your servletcontainer supports it, prefer 2.5:
<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_2_5.xsd"
version="2.5">
<!-- Config here. -->
</web-app>
O if it supports the latest version3.0
<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>
Otherwise everything will fall back to least supported modus and taglibs may break like that.
Also ensure that you don't have loose tld
files wandering around in the classpath (the /WEB-INF/lib
folder, among others), they will collide with the ones in JAR files. Oh, also ensure that you didn't manually define the tlds in web.xml
, keep it clean.
As far as i know you need jstl.jar and standard.jar. Put those under WEB-INF/lib.
You only need to specify this dependency in your Maven POM:
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
In my code, this provided everything I needed for the following JSP taglib to work:
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
I had the same issue and I simply put the prefix = "c" at the end of the taglib definition
before:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
after:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
And all warnings disappear from Eclipse.
add jstl-1.2-sources.jar into your Tomcat\lib directory