Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

JSTL tags not recognized  RSS feed

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a simple JSP page

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

<%String s= "Testing JSP";
out.println(s);
out.println("Hey this worked");
%>

<jsp:useBean id="now" class="java.util.Date" />
<p><h5>Last Updated on: <cut value="${now}"/></h5></p>

Setting the value: "Hello World!"
<c:set var="hello" value="Hello World!"/>
<p/>

<cut value="${hello}"/>

I have the tld files in web-inf/tld and accordingly defined in web.xml
it doesnt give any error but , it prints ${now} and ${hello} literally..

what am i missing?
Thanks
 
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Need to know what container you are using and its version. Tomcat 4? Tomcat 5? Other?
 
Rajani Deshpande
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually, it does reqcognize the c:foreach, but not c ut..
I tried this and this prints ${i} 10 times !

<c:forEach var="i" begin="1" end="10" step="1">
<cut value="${i}" />
<br />
</c:forEach>

what am i missing?

[ January 12, 2006: Message edited by: Rajani Deshpande ]
[ January 12, 2006: Message edited by: Rajani Deshpande ]
 
Rajani Deshpande
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using tomcat 5
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using Tomcat 5, you are using the wrong version of the JSTL. The URI you gave is for JSTL 1.0. You need JSTL 1.1.
[ January 12, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this JSP FAQ for details.

Also be sure that your web app is properly declared in the web.xml according to this other JSP FAQ.
[ January 12, 2006: Message edited by: Bear Bibeault ]
 
Rajani Deshpande
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using jstl 1.1 and i changed the uri to
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

but still no luck...???
 
Rajani Deshpande
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a bunch for the prompt replies!
It worked! I had to change web.xml too.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Rajani Deshpande:
Thanks a bunch for the prompt replies!
It worked! I had to change web.xml too.



You're welcome. Yes, without the web.xml change, Tomcat does not "turn on" the EL.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!