문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
wiki:spring:jstl [2020/03/24 21:35] dhan |
wiki:spring:jstl [2023/01/13 18:44] (현재) |
||
|---|---|---|---|
| 줄 7: | 줄 7: | ||
| </ | </ | ||
| <WRAP clear/> | <WRAP clear/> | ||
| + | |||
| + | ===== Rule ===== | ||
| + | <code jsp> | ||
| + | <c:if test=' | ||
| + | |||
| + | < | ||
| + | </ | ||
| + | > single 가급적 quotation으로 시작하고 그 내부에서 string일 경우 double quotation으로 처리한다. | ||
| + | > 마지막은 ${변수 }, 즉 space로 종료한다. | ||
| + | |||
| + | ===== c:out ===== | ||
| + | [[https:// | ||
| ===== Choose ===== | ===== Choose ===== | ||
| [[https:// | [[https:// | ||
| + | |||
| + | ===== Format ===== | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | |||
| + | ===== Length ===== | ||
| + | List Size값 출력 | ||
| + | <code jsp> | ||
| + | <%@ taglib uri=" | ||
| + | ${resultList.size } X | ||
| + | ${fn: | ||
| + | </ | ||
| + | |||
| + | ===== List ===== | ||
| + | [[https:// | ||
| + | <code jsp> | ||
| + | < | ||
| + | < | ||
| + | <c:out value=" | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| ===== Map ===== | ===== Map ===== | ||
| LIST 순회 | LIST 순회 | ||
| <code jsp> | <code jsp> | ||
| - | < | + | < |
| <tr> | <tr> | ||
| - | < | + | < |
| - | < | + | < |
| - | < | + | < |
| </tr> | </tr> | ||
| </ | </ | ||
| 줄 25: | 줄 60: | ||
| 키값으로 값 불러오기 1 | 키값으로 값 불러오기 1 | ||
| <code jsp> | <code jsp> | ||
| - | <c:out value="${resultMap['${key}']} /> | + | <c:out value='${resultMap["${key}"]' |
| </ | </ | ||
| 키값으로 값 불러오기 2 | 키값으로 값 불러오기 2 | ||
| <code jsp> | <code jsp> | ||
| - | <c:set var="idAsString"> | + | <c:set var='idAsString'> |
| - | <c:out value="${resultMap[idAsString].id }" | + | <c:out value='${resultMap[idAsString].id }' |
| </ | </ | ||
| 줄 40: | 줄 75: | ||
| eq | eq | ||
| <code jsp> | <code jsp> | ||
| - | null: <c:if test="${ null eq name }"></ | + | null: <c:if test='${ null eq name }'></ |
| - | 숫자: <c:if test="${ 0 eq name }"></ | + | 숫자: <c:if test='${ 0 eq name }'></ |
| - | 문자: <c:if test="${ ' | + | 문자: <c:if test='${ ' |
| </ | </ | ||
| ne or != | ne or != | ||
| <code jsp> | <code jsp> | ||
| - | null: <c:if test="${ null ne name }"></ | + | null: <c:if test='${ null ne name }'></ |
| - | 숫자: <c:if test="${ 0 eq name }"></ | + | 숫자: <c:if test='${ 0 eq name }"></ |
| - | 문자: <c:if test="${ 'string' | + | 문자: <c:if test='${ "string" |
| </ | </ | ||
| empty | empty | ||
| <code jsp> | <code jsp> | ||
| - | 객체의 값이 비어있을 때: <c:if test="${empty map}"</ | + | 객체의 값이 비어있을 때: <c:if test='${empty map }'</ |
| - | 객체의 값이 있을 때: <c:if test="${!empty map}"></ | + | 객체의 값이 있을 때: <c:if test='${!empty map }'></ |
| </ | </ | ||
| + | |||
| + | ===== Tag ===== | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | |||
| ===== Tip ===== | ===== Tip ===== | ||
| - | ===== Trouble shooting | + | ===== Troubleshooting |
| ===== Ref ===== | ===== Ref ===== | ||