• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL help please

 
Karthik Rajendiran
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to Configure JSTL with tomcat

1. I have installed tomcat and able to work with JSP stuffs
i copied the jstl.jar and standard.jar into my webapp\WEB-INF\lib directory
and put that in classpath variable to
2.
Should i have to configure any thing in tld and web.xml
If so what needs to
written in web.xml and tld.

Uri given in jsp
<%@ taglib prefix = "c" uri = "http://java.sun.com/jstl/core" %>
this gives error

Can anyone please explain what needs to done further to make the
jstl functions to work


******** MY JSP PAGE CODE SNIPPET ****************
<%@ page import="java.util.*,com.model.*" %>
<%@ taglib prefix = "c" uri = "http://java.sun.com/jstl/core" %>
<html>
<body>
Hi your in jsp <br>
<c:forEach var="brand" items = "${Players}">
${brand}
</c:forEach>
mail: ${initParam.AdminMail}
</body>
</html>
***************************************************

I get the following error

TestEL.jsp(6,0) According to TLD or attribute directive in tag file, attribute items does not accept any expressions


Can anyone please help me with this by providing a sample tld file
 
Vince Hon
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have encountered the same problem before.

If you are using Tomcat 5.0 (Servlet 2.4 and JSP2.0) and the JSTL is in 1.1 version. The *.tld is embedded in the standard.jar, and you do NOT NEED to declare the <taglib-uri> in the web.xml.

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

This will work.
 
Karthik Rajendiran
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Boss,
Actually i download the standard taglibs from the apache site.
Now its working
Let me try that too

THANKS MAN
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!