File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSTL tags not recognized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL tags not recognized" Watch "JSTL tags not recognized" New topic
Author

JSTL tags not recognized

Rajani Deshpande
Ranch Hand

Joined: May 08, 2000
Posts: 45
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Need to know what container you are using and its version. Tomcat 4? Tomcat 5? Other?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rajani Deshpande
Ranch Hand

Joined: May 08, 2000
Posts: 45
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

Joined: May 08, 2000
Posts: 45
using tomcat 5
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

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

Joined: Jan 10, 2002
Posts: 60053
    
  65

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

Joined: May 08, 2000
Posts: 45
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

Joined: May 08, 2000
Posts: 45
Thanks a bunch for the prompt replies!
It worked! I had to change web.xml too.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL tags not recognized
 
Similar Threads
jsp Iterate tag
Accessing an ArrayList of objects in JSP
Error in expression
problem in functions tld
jstl tlds entry in web.xml