This is what i am trying to do
1) My JSP looks some thing like this
<%@ taglib prefix = "c" uri = "http://java.sun.com/products/jsp/jstl/" %>
<html>
<body>
<% Sting [] testCforEach = {"A","B","c","D"}; %>
<table>
<c:forEach var = "item" items = "${testCforEach}" >
<tr>
<td>${var}</td>
</tr>
</c:forEach>
</body>
</html>
I have kept this jsp in one of the projects folders inside webapp folder.
This projects folder has a WEB-INF and lib folder.
Web.xml looks like this
<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">
</web-app>
No other tags in web.xml
I have also created a file with .tld extension and kept it in WEB-INF itself
I have named the tld file has MyTest.tld and it looks like this
<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib 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/web-jsptaglibrary_2_0.xsd" version ="2.0">
<tlib-version>1.2</tlib-version>
<uri>
http://java.sun.com/products/jsp/jstl/</uri>
</taglib>
I have put the jar files jstl.jar and standard.jar in WEB-INF /lib folder.
I got these two jar files when i downloaded tomacat 5.0.28
First i tried without writing a tld and just keeping the jar files in lib folder. That didnt work and then i wrote a tld.
If using tld for jstl is not correct, pls let me know how do i use jstl in my jsp's.
Thanks in Advance,
Suchitra