일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- dbContext
- extraParams
- minimalAPI
- lazy loading
- cpu불안들어옴
- vscode
- EFCore
- c#
- .net
- extjs
- React
- c#코딩의기술실전편
- intellij
- Request
- mac
- 상속
- 코드프로그래머스
- ORM
- LINQ
- scanner
- Config
- 명시적외래키
- a604mu
- ViewModel
- 스냅잘찍음
- wifi안됨
- JSON
- error
- JavaScript
- Store
- Today
- Total
ejyoo's 개발 노트
JSTL : forEach 증감변수 사용 'status' 본문
JSTL 문법의 for문 사용법
<c:forEach items="${리스트가 받아올 배열이름}" var=$"{for문안에서 사용할 변수}" varStatus="status">
status 는 for문의 돌아가는 상태를 알 수 있게 체크하여 준다
#{status.current} 현재의 for문에 해당하는 번호
#{status.index} 0부터의 순서
#{status.count} 1부터의 순서
#{status.first} 현재 루프가 처음인지 확인
#{status.last} 현재 루프가 마지막인지 확인
#{status.begin} for문의 시작 값
#{status.end} for문의 끝 값
#{status.step} for문의 증가값
http://jsonlee.tistory.com/52[JSTL] List결과값에 대해 Index별 접근
2009/12/07 12:57 from web development/JAVA
<c:forEach items="${gamelist}" var="b" varStatus="status">
[${status.index}]: ${gamelist[status.index]}
<TR>
<TD>${b.gameid}</TD>
<TD>${b.displaytype}</TD>
<TD>${b.displayno}</TD>
<TD>${b.gamelink}</TD>
<td><c:if test="${b.ishidden=='T'}"><span style="color:red">Hidden</span></c:if></td>
<td>${b.lang}</td>
<td><a href="javascript:edit(${b.bid})">[Edit]</a></td>
</TR>
</c:forEach>
.index는 0부터 시작하고
.count는 1부터 시작한다.