====== JSTL 활용법 ====== * description : JSTL 관련된 사용방법 * author : 주레피 * email : dhan@repia.com * lastupdate : 2020-03-19 ===== Rule ===== ${entry.key.class } > single 가급적 quotation으로 시작하고 그 내부에서 string일 경우 double quotation으로 처리한다. > 마지막은 ${변수 }, 즉 space로 종료한다. ===== c:out ===== [[https://webcoding.tistory.com/entry/JSP-JSTL-cout-%ED%83%9C%EA%B7%B8-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0|[JSP] JSTL c:out 태그 사용하기]] ===== Choose ===== [[https://enzycut.tistory.com/entry/JSTLchoose-when-otherwise-%EC%82%AC%EC%9A%A9%EB%B2%95|[JSTL]choose와 when, otherwise 사용법]] ===== Format ===== [[https://zzznara2.tistory.com/688|[jstl] Date형과 String형인 경우 jstl(fmt)로 날짜 포맷에 맞게 출력하는 방법]] \\ [[https://cofs.tistory.com/39|jstl / el / 나누기 / % / 소수점 표시하기]] \\ ===== Length ===== List Size값 출력 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> ${resultList.size } X ${fn:length(resultList) } O ===== List ===== [[https://stackoverflow.com/questions/14737337/how-to-iterate-over-a-list-of-lists-in-jstl|How to iterate over a list of lists in jstl?]] \\ ===== Map ===== LIST 순회 ${entry.key } ${entry.value } ${entry.key.class } 키값으로 값 불러오기 1 키값으로 값 불러오기 2 ${resultInfo.id } [[https://enterkey.tistory.com/391|JSTL 에서 MAP 접근, 출력(KEY로 바로 값 추출)]] ===== Test ===== [[https://dondons.tistory.com/16|[JSTL] 비교연산 eq, ne, empty]] eq null: 숫자: 문자: ne or != null: 숫자: empty 객체의 값이 비어있을 때: 객체의 값이 있을 때: ===== Tag ===== [[https://kkith.blog.me/220352327172|전자정부 표준프레임워크 사용자 태그 정의 하기]] \\ [[https://www.4te.co.kr/569|클래식 커스텀 태그]] \\ ===== Tip ===== ===== Troubleshooting ===== ===== Ref ===== * [[https://littlecarbb.tistory.com/entry/34-JSTL-core-%EB%B3%80%EC%88%98-%EC%84%A4%EC%A0%95-%ED%83%9C%EA%B7%B8-cset-cremove|[34] JSTL core : 변수 설정 태그 ]] * [[https://meaownworld.tistory.com/123|JSTL c tag 에서 eq, ne null check 하기]] {{tag>주레피 JSTL jstl}}