Actually I think it's ${current.count} -----Original Message----- From: Kishore Senji [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 12:37 PM To: Struts Users Mailing List Subject: Re: Unable to see <c:forEach> out put
On Wed, 12 Jan 2005 13:52:32 +0530, Vamsee Kanakala <[EMAIL PROTECTED]> wrote: > Rick Reumann wrote: > > > It sounds like you are probably are now using a JSP2.0 container like > > Tomcat5 and are refering to the wrong tld. Refer to the one in the jar > > like: > > > > <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> > > > > and remove and direct pointing to the tlds you have. > > Yes, I am using Tomcat 5.0.28. I then downloaded beanutils from the > jakarta site, replaced the jstl.jar and standard.jar, and pointed to > taglibs like you said above. I have strange problem - I am able to use > <c:forEach> etc., but the "var" is not getting set. If I give something > like this: > > <c:forEach begin="1" end="5" var="current"> > <c:out value="${current}" /> > </c:forEach> > > I get something like this: > > ${current} ${current} ${current} ${current} ${current} > Well, If you use "var" attribute; <c:forEach/> tries to assign the current element of the iteration over a collection to a variable with that name. If you don't have any collection specified by the attribute "items" then nothing is set to the "var" attribute; in other words a variable with that name doesn't exist. If you wanted to see the loop counter you could use <c:forEach begin="1" end="5" varStatus="current"> <c:out value="${current}" /> </c:forEach> > I can't figure out what seems to be the problem. Please help. > > TIA, > Vamsee. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]