js|xml
<% taglib uri="..." prefix="tl" %>
<html>
<tl:parse id="saleBooks" type="BookInventory"
xml="Book_Inventory_URL"/>
<head>...
<body>
<table border="0" width="50%">
<tl:iterate
id ="bk" type="Book"
collection="<%= saleBooks.getBooks()%>" >
<tr>
<td><jsp:getProperty name="bk" property="title"/></td>
</tr>
</tl:iterate>
</table>
</body>
</html>
2.4 Parse and Iterate
<% taglib uri="..." prefix="tl" %>
<html>
<head>...
<body>
<table border="0" width="50%">
<tl:iterateOnXMLStream
id="bk" type="Book"
xml="Book_Inventory_URL">
<tr>
<td><jsp:getProperty name="bk" property="title"/></td>
</tr>
</tl:iterateOnXMLStream>
</table>
</body>
</html>
2.5 Combining Data
(插图2)
2.6 Insert After Transformation
<%taglib uri="http://jakarta.apache.org/taglibs/xsl/1.0"
prefix="x" %>
<html>
<head>...
<body>
<center> Welcome
<x:apply xml="Customer_URL" xsl="store.xsl"/>!
<p>
On Sale Today ...
<p>
<x:apply xml="Inventory_URL" xsl="store.xsl"/>
</center>
</body>
</html>
2.7 Producing XML
* Client may be
– Gateway
– Device (WAP, XHTML)
* XML
* XML + StyleSheet
2.8 VoiceXML and WAP Gateways
(插图3)
2.9 Generating XML
J1 java.sun.com
(插图4)
2.10 XSLT on XML
(插图5)
2.11 JSP and XSLT
* JSP strengths
– Template & Java
– Multiple Sources
– Open-ended Portable Abstraction
* XSLT strengths
– Recursive tree transformation
– Well defined input/output
* XPath
2.12 Generating Content for
Multiple Devices
* One back end source
* Many clients
* Minimize Total Maintenance Cost
* Desired Generation Performance
2.13 Multiple Clients
XSLT Stylesheet
(插图6)
2。14 Multiple Clients
Short Pipelines
(插图7)
2.15 Multiple Clients
Combined Approach
(插图8)
2.16 Uses of XML in JSP Technology
* JSPs Pages
JSP Pages as XML documents
* XML configuration
2.17 JSP Pages as XML Documents
* Manipulation
– Apply XSLT to generate JSP
* Authoring
– JSP pages from XML objects
* Validation
– TagLibraryValidator
* Standarized in JSP 1.2
2.18 XML Configuration
* Tag Library Descriptor
* Servlet configuration
– Resources
– Mappings
– Filters (JSP 1.2)
– others
3 现状
3。1 Industry Support
Containers
Apache
Allaire
ATG Dynamo
BEA Weblogic
Bluestone
Caucho
Gemstone
IBM’ s WebSphere
Inprise AppServer
Iplanet iWS, iAS
Oracle
Persistence
Unify
Some Users
* PeopleSoft
* I2
* CP
* ...
Some Sites
* Delta.com
* Food.com
* CarOrder.com
* ...
Tools
* MacroMedia
UltraDev
* Adobe GoLive
* Unify eWeb Studio
* WebGain’ s Studio
* Forte for Java
* Oracle Jdeveloper
* Inprise Jbuilder
* ATG Dynamo
* ...
3。2 New JSP & Servlets
* JSR-053
* Servlet 2.3
– Filters
– Application Events
* JSP 1.2
– XML view of JSP page
– Many improvements & refinements
* Implementation ASF
– jakarta.apache.org/tomcat
3。3 JSP Tag Library
* JSR-052
* Standard JSP tag library
– Rich functionality
– XSLT
– XPATH
– Other XML processing
* Implementation ASF
– jakarta.apache.org/taglibs
3。4 Framework efforts
* J2EE Framework
– Blueprints
* JSP / Servlet Framework
– Struts
– Implementation ASF
– jakarta.apache.org/struts
3。5 JSP Tool Support
* Mostly for Page Authoring
– Some for TagLib Authoring
* Already in several tools
– e.g. UltraDev support in Struts
* Focus next 6 months
– Standard taglib
– Any taglib
3。6 XML Parsing & Transformation
* JAXP 1.1
– Part of next J2SE (JDK)
– DOM level 2
– XSLT
– Combined with TRaX (XSLT activation)
– Implementation ASF
* XSLTC
– XSLT compiler
– Fast, Small footprint
3。7 Data Binding
Beans Long Term Persistance
* Adelard
– Part of next J2SE
– Data Binding
* JavaBeans Long Term Persistance
– Part of next J2SE
– Generic Swing Machinery
3。8 XML Messaging
* XML messaging
– JMS
– ebXML
– JAXM
– Message Beans (J2EE 1.3)
**************************************************
Review
* JSP, Servlets & J2EE
* JSP
– Consuming XML
– Transforming XML
– Producing XML
– Relationship with XSLT
* Status of several JSP/XML efforts