xgao (2) [Avatar] Offline
#1
joshua.white (14) [Avatar] Offline
#2
Re: confusion on page 80
xgao,

This variable is created by the enclosing JSTL tag. This would have been more clear if the tag was defined like this:

<c:forEach var="member" items="${memberList}" varStatus="status">

When you specify the varStatus attribute, a scoped variable is created using the specified name. This variable is of type javax.servlet.jsp.jstl.core.LoopTagStatus and exposes several helpfull properties (current, index, count, first, last, begin, step, end) that describe the current state of the iteration. See the following link for more information:

http://download.oracle.com/docs/cd/E17802_01/products/products/jsp/jstl/1.1/docs/api/javax/servlet/jsp/jstl/core/LoopTagStatus.html

Based on what I have read, there is no "default" value if this attribute is not explicitly specified. As a result, you may have found a bug/typo.

I hope this makes this more clear.

Regards,

Joshua
xgao (2) [Avatar] Offline
#3
Re: confusion on page 80
Thank you Joshua

I have another question. the status.index is used
as a member.id to create the link.

<a href="member.do?id=${status.index}">

however, it seems to be the index of the current round of
the iteration. Is that the value of member ID?
bato (12) [Avatar] Offline
#4
Re: confusion on page 80
Thanks for the hint.
In my test environment the link to member was not correct before I set the attribute varStatus="status"