• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL and EL

 
Ken Sampson
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am unable to work with EL. I use tomcat 6.0 with jstl 1.1.2. When I do not use jstl EL works perfectly but if I try to use jstl then the evalution fails.

My directory structure looks like this:
tomcat/webapps/myapp/WEB-INF/lib/jstl.jar
tomcat/webapps/myapp/WEB-INF/lib/standard.jar
tomcat/webapps/myapp/WEB-INF/c.tld
tomcat/webapps/myapp/WEB-INF/web.xml
tomcat/webapps/myapp/test.jsp

in the web.xml this is what I have mentioned
<web-app>

<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>

</web-app>

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

<html>
<body>
The value of \${3+2} is ${3+2}
</body>
</html>

when I try to run test.jsp this is wht i get:

The value of ${3+2} is ${3+2}

please help me to resolve this issue
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kaushik Samaddar:
tomcat/webapps/myapp/WEB-INF/c.tld

Why do have c.tld in WEB-INF? Did you extract it from the jar file? Why?

Tomcat will find the TLD file in the jar file. Remove c.tld from WEB-INF.


in the web.xml this is what I have mentioned
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>

Likewise this is unnecessary. Remove it.

Once you've got that cleaned up, let's see if your problem persists. If it doesn't we'll know it's not the extra goo and can proceed from there.
[ January 22, 2008: Message edited by: Bear Bibeault ]
 
Ken Sampson
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thank you so much for your assistance. The problem has been resolved. I have removed c.tld from WEB-INF and taglib declaration from web.xml.

Instead this is how I hv changed my web.xml

<web-app id="WebApp_ID"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
</web-app>

and also I have included jstl1.2.jar in WEB-INF/lib .

On starting tomcat this works perfectly. I guess the real problem was not mentioning the DTD properly.

Thanks a lot!!
 
Paritosh Ranjan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Hijack removed]
[ January 23, 2008: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paritosh,
Please ask your question in a new thread.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!