JSTL 1.1
JSTL JavaServer Pages Standard Tag Library
1.1 JSTL JCP Java
Community Process
Java Web
Web JSTL EL Web
Java Scripting
JSTL
URL
U18N
XML SQL JSTL
JSTL
7-1 JSTL 1.1
7-2 Core tag library
7-3 i18n i18n-capable formatting tags
library
7-4 SQL SQL tag library
7-5 XML XML tag library
7-6 Functions tag library
JavaServer Pages Standard Tag Library
1.1 JSP
JSTL
XML
JSTL
1. Core tag library
2. I18N I18N-capable formatting tag library
3. SQL SQL tag library
4. XML XML tag library
5. Functions tag library
JSTL EL Expression Language
JSP
7-2
7-1 JSTL 1.1
JSTL
c <c:out>
URI
http://java.sun.com/jsp/jstl/core
SQL
sql <sql:query>http://java.sun.com/jsp/jstl/sql
XML
xml <x:forBach>http://java.sun.com/jsp/jstl/fmt
fn <fn:split>http://java.sun.com/jsp/jstl/
functions
I18N
fmt <fmt:format
Date>
http://java.sun.com/jsp/jstl/xml
<%= userList.getUser().getPhoneNumber() %>
JSTL
JSTL EL
Java Script
Java
7-1-1 JSTL 1.1
JSTL 1.1 Servlet 2.4 JSP 2.0 Container
JSTL Apache Jakarta Project
http://jakarta.apache.org/builds/jakarta-taglibs/releases/standard/
JSTL 1.1 JSTL 1.1 jakarta-taglibs-
standard-current.zip
7-3
Chapter 7 JSTL 1.1
<c_rt:out value="<%= userList.getUser( ).getPhoneNumber( ) %>" />
<c:out value="${userList.user.phoneNumber}" />
7-1 jakarta-taglibs-standard-1.1.0-B1
lib jstl.jar standard.jar Tomcat WEB-INF\lib
JSP JSTL .jar tld
WEB-INF
- HelloJSTL.jsp
HelloJSTL.jsp
7-4
lib jstl.jar standard.jar old-dependencies
JSTL 1.0 JSTL 1.1
tld TLD JSTL 1.0 TLD
c-1_0.tld c-1_0-rt.tld
<%@ page contentType="text/html;charset=big5" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>
JSTL
</title>
</head>
<body>
<c:out value="
JSTL "/>
</br>
:
</br>
<c:out value="${header['User-Agent']}"/>
</body>
</html>
HelloJSTL.jsp Core
EL header JSP JSTL
JSTL
(prefix) c uri
http://java.sun.com/jsp/jstl/core
out
value ${header['User-
Agent']}
User-Agent
HelloJSTL.jsp 7-2
7-5
Chapter 7 JSTL 1.1
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
JSTL 1.0 uri http://java.sun.com/jstl/core
JSTL 1.1 jsp/ JSTL 1.1 JSTL 1.0 1.1
uri http://java.sun.com/jstl/core
JSTL 1.0
<c:out value=" JSTL " />
<c:out value="${header['User-Agent']}" />
7-2 HelloJSTL.jsp
评论0