I've been trying to get this to run, but I can't. I'm using Eclipse Galileo, Tomcat 5.5.23 and have several JSTLs around. My latest try was to use the GlassFish jar file "jstl-impl-1.2.jar". I placed it in Tomcat's shared lib, added it as external jar into my Eclipse project and exported it.
Could anybody tell me, which jars to load in which folder and how to tell it to load in Eclipse?
You can dive into our beloved stackoverflow.com to find out that Tomcat doesn't include JSTL,not even in Tomcat 8, in spite that they have an implementation of the JSP Standard Tag Library (JSTL) specification, versions 1.0, 1.1 and 1.2.
The Formatting tags provide support for message formatting, number and date formatting, etc. The URL for the Formatting tags is http://java.sun.com/jsp/jstl/fmt and prefix is fmt. The XML tags provide flow control, transformation, etc. The URL for the XML tags is http://java.sun.com/jsp/jstl/xml and prefix is x.
JSTL - Core <c:forEach>, <c:forTokens> Tag The <c:forEach> tag is a commonly used tag because it iterates over a collection of objects. The <c:forTokens> tag is used to break a string into tokens and iterate through each of the tokens.
It's very simple to include jstl in your projects, what I do is:
Download jstl-1.2.jar (JSP 2.1 containers only i.e. Tomcat 6, otherwise jstl-1.1.jar) from http://repo1.maven.org/maven2/javax/servlet/jstl/1.2/
or
the interfaces (javax.servlet.jsp.jstl-api-1.2.1.jar) from http://search.maven.org/#browse|707331597 and the actual implementing classes (javax.servlet.jsp.jstl-1.2.2.jar) from http://search.maven.org/#browse%7C-1002239589.
Copy to your project's WEB-INF/lib directory
As for eclipse I need to know if your using any framework plugin, I use MyEclipse and it does it automatically for me.
Another method is shown here https://stackoverflow.com/tags/jstl/info
In short, download jstl.jar from here:
http://download.java.net/maven/1/jstl/jars/jstl-1.2.jar
and drop it in your WEB-INF/lib dir
and add the line:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
in your jsp file.
(don't forget to do F5 and clean and build after that)
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