WebLogic Server 6.1 Code Examples, BEA Systems, Inc.

Package examples.xml.dom

This example demonstrates how to parse an XML document using a DOM parser obtained via JAXP.

See:
          Description

Package examples.xml.http Description

This example demonstrates how to parse an XML document using a DOM parser obtained via JAXP.

The example receives an XML file over HTTP from a Client and uses the DOM API (via JAXP) to parse the document.

The example illustrates how to:

Additional Resources for examples.xml.dom
Dom.jsp The JSP that receives the XML data from the Java Client, parses it, and sends an acknowledgement back to the Client over HTTP.
stock_quote.xml The XML file that is passed between the Java Client and the JSP over HTTP.
 

The following sections describe how to build and run the example.

  1. Build the example
  2. Run the example

Build the example

  1. Set up your development shell as described in Setting up your environment.

  2. Compile the example by executing the Java ant command. The Java ant command uses the build.xml file, located in the samples/examples/xml/dom directory, to build the example. The Java Ant command performs the following steps:

    1. Compiles the Client.
    2. Copies the Dom.jsp file into the examples Web application directory.
    3. Compiles the JSP Dom.jsp into the WEB-INF\classes of the examples Web application.

Run the Example

  1. Start the WebLogic Server in a new command shell.

  2. In your development shell, run the Client with the following command:
      $ java examples.xml.Client http://hostname:port/examplesWebApp/Dom.jsp stock_quote.xml
    where:
    hostname
    Host name of the WebLogic Server.
    port
    Port where the WebLogic Server is listening for connections (weblogic.system.ListenPort).

There's More...

Read more about:


Documentation is available at
http://e-docs.bea.com/wls/docs61

Copyright © 2000-2001 BEA Systems, Inc. All Rights Reserved.