Js|xml
This article outlines:
* JSP, Servlets & Java EE
* JSP & XML
* Status Quo
1 JSP, Servlets & Java
1.1 Java Platform
* With clear specifications
* After a variety of compatibility tests
* With a number of implementation references (RI)
* Rich functions are embodied in the following areas:
–jsp/servlets
–jdbc
–ejb
–jms
–connector to EIS (Java 1.3)
* Has very practical value
The web layer where the 1.2 Java EE resides
The role played by 1.3 jsp/servlets
(Translator Note: I mix JSP with Servelet, you can refer to the text attached to this article)
* Entrance to Application
* Interacting with the outside world
* HTTP protocol is generally used
* Clients may be of the following types:
-Browser
-Applet
-Desktop Application (Java Web Start)
-Wireless devices
-Server Application (business-to-business)
The use of 1.4 jsp/servlets
* Can be used for
–jsp & Servlet Container
–J2EE Container
* Common Mindshare
* Best-of-breed Implementation
* has received extensive support
* Dynamic Content Generation
* With a simplistic framework
* Managed by container
* Always use JavaBeans and tag Lib
1.5 An example
<?xml version= "1.0" >
<%@ page contenttype= "Text/xml"%>
<%@ taglib prefix= "x" uri= "..."%>
<wml>
<card id= "Card1" title= "Flowers" >
<p>
Flowers available:
<br/>
<x:enumerate inventory= "Flowers"
Id= "Aflower" >
<%= Aflower.type%>
<br/>
</x:iterate>
<br/>
</p>
</card>
</wml>
1.6 Tag Lib
* Abstract Extraction
* XML syntax
* Run-time Agreement
– Integrated into the JSP page
-Easy to mix and customize
– Managed by JSP container
– Simple protocols for simple requirements
1.7 Roles of various collaborative work
* Site page author
– Create an expression from data that is provided by the data developer presentation
– An expert in user interface
– Use tag lib and JavaBeans
– Use the Page tool
* Developer
– Provide data access for page authors
– Experts on server-side organizations
– Define tag Lib and JavaBeans
–ide
2 JSP & XML
Application of 2.1 XML in JSP technology
JSP pages can:
– Use XML
– Generate XML
– Change XML
* Use JSP pages as XML documents
* XML configuration
2.2 Using XML
* Parse XML to object (completed by developer)
– Hard coded
-Use Adelard Technology
* Parsing and retelling abstractions
* Insert –xslt after transformation
2.3 Parsing becomes an object
<%@ taglib uri= "..." prefix= "TL"%>
<tl:parse id= "Salebooks" type= "Bookinventory"
Xml= "Book_inventory_url"/>
<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>
2.4 Parsing and retelling
<%@ taglib uri= "..." prefix= "TL"%>
<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>
2.5 Combination Data
2.6 After conversion insert
<% @taglib uri= "http://jakarta.apache.org/taglibs/xsl/1.0"
prefix= "x"%>
<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>
2.7 Making XML
* The client can be
–gateway Gateway
– Devices (WAP, XHTML)
* XML
* XML + stylesheet style sheet
2.8 VoiceXML and WAP Gateway Gateways
2.9 Generating XML
2.10 XSLT on XML
2.11 JSP and XSLT
* JSP Enhanced:
–template & Java
–multiple Sources
–open-ended Portable Abstraction
* XSLT reinforces the following:
-Cycle of tree transformation
– well defined input and output
* XPath
2.12 Generated content for
Multiple Devices
* One back end source
* Many customers
* Minimizing total maintenance costs
* To achieve expected performance
XSLT styles for more than 2.13 customers
Short pipelines for more than 2.14 customers
2.15 Multi-Customer combination approach
2.16 using XML in JSP technology
* JSPs Pages
To use a JSP page as an XML document
* Manipulation
–apply XSLT to generate JSP
* Authoring
–jsp pages from XML objects
* Validation
–taglibraryvalidator
* Standarized in JSP 1.2
* XML configuration
* Tag Library Descriptor
* Servlet Configuration -->