Presentation is loading. Please wait.

Presentation is loading. Please wait.

Coypright (c) Ning Chen, Ph.D. 20011 CPSC 425 Java Enterprise Application Programming Presented by Ning Chen, Ph.D. Chair/Professor Department of Computer.

Similar presentations


Presentation on theme: "Coypright (c) Ning Chen, Ph.D. 20011 CPSC 425 Java Enterprise Application Programming Presented by Ning Chen, Ph.D. Chair/Professor Department of Computer."— Presentation transcript:

1 Coypright (c) Ning Chen, Ph.D. 20011 CPSC 425 Java Enterprise Application Programming Presented by Ning Chen, Ph.D. Chair/Professor Department of Computer Science California State University, Fullerton Fall 2002 Module XML

2 Coypright (c) Ning Chen, Ph.D. 20012 XML [Source: Mastering Enterprise JavaBeans by Ed Roman] The Extensible Markup Language (XML) is a universal standard for structuring content in electronic documents. XML is extensible, enabling business to add new structure to their documents as needed. The XML standard does not suffer the version control problems of other markup languages such as HTML, because it has no predefined tags. Rather, with XML you define your own tags for your business needs. This makes XML the ideal document format for transferring business data electronically, and it has a wide variety of other applications as well.

3 Coypright (c) Ning Chen, Ph.D. 20013 Benefits of XML [Source: Mastering Enterprise JavaBeans by Ed Roman] XML is simple and easy to use XML is an open, internet-standard XML is human readable XML has massive industry support behind it XML has great tools available

4 Coypright (c) Ning Chen, Ph.D. 20014 XML Concept [Source: Mastering Enterprise JavaBeans by Ed Roman] An XML document example Year 1984 George Orwell 268 The Catcher in The Rye J. D. Salinger 249

5 Coypright (c) Ning Chen, Ph.D. 20015 XML Concept [Source: Mastering Enterprise JavaBeans by Ed Roman] Prolog: XML Elements: The Catcher in The Rye Attributes: The Root Element: (There are others that are not covered here.)

6 Coypright (c) Ning Chen, Ph.D. 20016 XML Parsers [Source: Mastering Enterprise JavaBeans by Ed Roman] An XML parser is a program that reads in an XML document and verifies whether it is well formed. A not well-formed example: Year 1984 George Orwell 268

7 Coypright (c) Ning Chen, Ph.D. 20017 XML DTDs [Source: Mastering Enterprise JavaBeans by Ed Roman] DTD – Document type definition Valid Documents: An XML document is valid if it satisfies the structural rules laid out in its corresponding DTD.

8 Coypright (c) Ning Chen, Ph.D. 20018 XML DTDs [Source: Mastering Enterprise JavaBeans by Ed Roman] A sample XML DTD: <!DOCTYPE library [ ]>

9 Coypright (c) Ning Chen, Ph.D. 20019 XML DTDs [Source: Mastering Enterprise JavaBeans by Ed Roman] An XML validating parser is a program that checks that an XML document is valid according to its DTD.

10 Coypright (c) Ning Chen, Ph.D. 200110 What Is the config.xml File? [Source: edocs.bea.com] The config.xml file is an XMLdocument that describes the configuration of an entire Weblogic Server domain. The config.dtd Document Type Definition (DTD) describes the content and structure of the config.xml file. The DTD describes the valid XML tags, the tag order, whether the tags are optional, the type of data contained within the tags, the tag attributes, the attribute values, and so on.

11 Coypright (c) Ning Chen, Ph.D. 200111 Using Deployment Descriptors to Configure and Deploy Servlets [Source: edocs.bea.com] The first deployment descriptor, web.xm l, is defined in the Servlet 2.2 specification from Sun Microsystems and provides a standardized format that describes the Web Application. The second deployment descriptor, weblogic.xm l,isa WebLogic-specific deployment descriptor that maps resources defined in the web.xml file to resources available in WebLogic Server, defines JSP behavior, and defines HTTP session parameters.

12 Coypright (c) Ning Chen, Ph.D. 200112 web.xml (Web Application Deployment Descriptor) In the Web Application deployment descriptor you define the following attributes for HTTP servlets: Servlet name Java class of the servlet servlet initialization parameters Whether or not the init() method of the servlet is executed when WebLogic Server starts URL pattern which, if matched, will call this servlet Security MIME type Error pages References to EJBs References to other resources

13 Coypright (c) Ning Chen, Ph.D. 200113 Directory Structure [Source: edocs.bea.com]

14 Coypright (c) Ning Chen, Ph.D. 200114 WEB.XML Location

15 Coypright (c) Ning Chen, Ph.D. 200115 WEB.XML Build Location

16 Coypright (c) Ning Chen, Ph.D. 200116 WEB.XML HelloWorldServlet examples.servlets.HelloWorldServlet HTTPPostServlet examples.servlets.HTTPPostServlet

17 Coypright (c) Ning Chen, Ph.D. 200117 WEB.XML HelloWorldServlet /HelloWorldServlet/* HTTPPostServlet /HTTPPostServlet/*


Download ppt "Coypright (c) Ning Chen, Ph.D. 20011 CPSC 425 Java Enterprise Application Programming Presented by Ning Chen, Ph.D. Chair/Professor Department of Computer."

Similar presentations


Ads by Google