Download presentation
Presentation is loading. Please wait.
Published byEdgar Walsh Modified over 9 years ago
1
JSP Standard Tag Library (JSTL) Internet Computing Laboratory @ KUT Youn-Hee Han
2
Web Programming2 JSTL 기본 문법 OR some body content Web root (2006777888) WEB-INF lib classes jstl.jar standard.jar 다운로드 하여 lib 디렉토리에 추가
3
Web Programming3 JSTL 기본 JSP 에 taglib Directive 추가 import into your JSP page each JSTL library that the page will reference. taglib directives core: Basic scripting functions such as loops, conditionals, and input/output xml: XML processing fmt: Internationalization and formatting of values such as currency and dates sql: Database access fn: JSTL functions
4
Web Programming4 JSTL “Hello World” JSTL 기본 예제 Setting the value: "Hello World!" /2006777888/hellojstl.jsp
5
Web Programming5 JSTL Sample JSTL Example 1 0) { for (int i=0; i<list.size(); i++) { Data data = (Data) list.get(i); %> … 데이터가 없습니다. <% } %> ${data.title} 데이터가 없습니다.
6
Web Programming6 JSTL Sample JSTL Example 2 <% String op1 = request.getParameter("option1"); if ( op1 != null ) { %> <% } %> ${param.option1} JSTL Example 3 <% Map likeMap = request.getParameterMap(); String[] like = (String[])likeMap.get("like"); for(int i=0; i<like.length;i++){ %> <% } %> ${i}
7
Web Programming7 JSTL Sample JSTL Example 4-1 Customer Names <% List addresses = (List)request.getAttribute("addresses"); Iterator addressIter = addresses.iterator(); while(addressIter.hasNext()) { String addr = (String)addressIter.next(); if ((addr != null) && (addr.getLastName() != null) && (addr.getLastName().length() > 0)) { %> <% } else { %> N/A <% } %> Last Updated on:
8
Web Programming8 JSTL Sample JSTL Example 4-2 Customer Names N/A Last Updated on:
9
Web Programming9 JSTL Sample JSTL Example 5 ABC " /> ${a} JSTL Example 6 ( 교재 433page 소스코드를 JSTL 코드로 변환 ) " /> ${i}
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.