목차

JSTL

forEach varStatus

Property Getter Description
currentgetCurrent()The item (from the collection) for the current round of iteration
indexgetIndex()The zero-based index for the current round of iteration
countgetCount()The one-based count for the current round of iteration
firstisFirst()Flag indicating whether the current round is the first pass through the iteration
lastisLast()Flag indicating whether the current round is the last pass through the iteration
begingetBegin()The value of the begin attribute
endgetEnd()The value of the end attribute
stepgetStep()The value of the step attribute

null 검사

<%-- 아래는 객체가 안 비었는지 여부(null, 빈 문자열, 빈 배열, 빈컬렉션 검사이다. --%>
<c:if test="${not empty obj}">
...
 
<%-- 아래는 null만 검사한다 --%>
<c:if test="${obj != null}">
...
혹은
<c:if test="${obj ne null}">
...