개발_참고하기/개발
JSTL_forEach문, if문 사용법
정보 공유 블로그
2021. 5. 21. 15:28
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 | JSTL forEach문 사용법 if문으로 조건 설정하고 forEach문으로 id, name 값을 유동적으로 설정할수 있다. <c:if test="${Test04.inspect_state_ge ne 'ing'}"> <table cellpadding="0" cellspacing="0"> <c:forEach begin="1" end ="4" var="i" varStatus="j"> <c:set var="imgExplain">img_explain${i}></c:set> <tr class="item${j.count}"> <input type="hidden" id="img_path${j.count}" name="img_path${j.count}"/> <th>설명</th> <td> <input type="text" id="img_explain${j.count}" name="img_explain${j.count}" value="{$Test04[imgExplain]}" </td> </tr> <tr class="item${j.count}"> <th>사진파일명</th> <td> <input type="text" id="img_nm${j.count}" name="img_nm${j.count}" value="{$Test04[imgNm]}" </td> </tr> </table> </c:if> | cs |