1 / 11

Java EE 5

Java EE 5. JavaServer Pages Documents. Outline. Introduction Adventages Identify Syntax. Introduction. A JSP document is a JSP page written in XML syntax. Because it is written in XML syntax, a JSP document is also an XML document. Adventages.

meara
Télécharger la présentation

Java EE 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java EE 5 JavaServer Pages Documents

  2. Outline • Introduction • Adventages • Identify • Syntax

  3. Introduction • A JSP document is a JSP page written in XML syntax. • Because it is written in XML syntax, a JSP document is also an XML document.

  4. Adventages • You can author a JSP document using one of the many XML-aware tools on the market, enabling you to ensure that your JSP document is well-formed XML. • You can validate the JSP document against a document type definition (DTD).

  5. Identify • • Use a Java Servlet Specification version 2.4 web.xml file and give your JSP document the .jspx extension. • • Include a jsp:root element in your JSP document. This method is backward-compatible with JSP 1.2. • • In your application's web.xml file, set the is-xml element of the jspproperty-group element to true.

  6. Syntax

  7. Syntax - Directives • <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> • <…xmlns:c="http://java.sun.com/jsp/jstl/core"… • xmlns:u="urn:jsptld:/WEB-INF/tlds/my.tld“ • xmlns:u="urn:jsptagdir:/WEB-INF/tags/my/"

  8. Syntax - Directives • <%@ page language="java" %> • <jsp:directive.page language="java" /> • <%@ include file="url" %> • <jsp:directive.include file="url" />

  9. Syntax – jsp:root • <jsp:root> … </jsp:root> • When you want to identify the document as a JSP document to the JSP container without having to add any configuration attributes to the deployment descriptor or name the document with a .jspx extension • When you want to generate—from a single JSP document—more than one XML document or XML content mixed with non-XML content

  10. Syntax - jsp:text • <jsp:text> … </jsp:text> • <jsp:text><![CDATA[ …]]></jsp:text>

  11. Syntax – jsp:element • <jsp:element name=“top"> <jsp:attribute name="a">0</jsp:attribute> <jsp:body>cool</jsp:body></jsp:element> • <top a="0">cool</top> • <top a="0" />

More Related