tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Billy Bacon <billy.ba...@thirty3.net>
Subject Re: Adding 1 to my varStatus variable within a <c:forEach> tag
Date Mon, 15 Sep 2003 17:52:51 GMT
Awesome. Actually for those interested, the syntax is...

${counter.index + 1} // index returns you the status of the counter.

Thanks Adam.

- Billy -

On 9/15/03 11:39 AM, "Adam Hardy" <ahardy.struts@cyberspaceroad.com> wrote:

> status is an object, you have to retrieve its counter property.
> 
> Something like ${counter.count + 1}
> 
> (but that's off the top of my head, so the property name might not be
> right.)
> 
> Adam
> 
> On 09/15/2003 07:07 PM Billy Bacon wrote:
>> I'm getting an exception for adding 1 to my counter variable with my
>> <c:forEach> tag.
>> 
>> ServletException in:/jsp/kmoCreateSimpleBody.jsp] An error occurred while
>> evaluating custom action attribute "value" with value "${counter +1}":
>> Attempt to coerce a value of type
>> "javax.servlet.jsp.jstl.core.LoopTagSupport$1$Status" to type
>> "java.lang.Long" (null)'
>> 
>> 
>> Here's my loop tag...
>> <c:forEach items="${kmoCreateSimpleForm.map.contentFields}"
>> var="contentField" varStatus="counter">
>> 
>> And here's the tag it doesn't like...
>> 
>> <html-el:hidden property="fieldLabel${contentField.id}" value="${counter
>> +1}"/>
>> 
>> Does anyone know how I could get this to work the correct way?
>> 
>> Thanks in advance
>> 
>> - Billy -
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>> 
>> 


Mime
View raw message