WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.xml.http
Class StockClient

java.lang.Object
  |
  +--org.xml.sax.HandlerBase
        |
        +--examples.xml.http.StockClient
All Implemented Interfaces:
org.xml.sax.DocumentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class StockClient
extends org.xml.sax.HandlerBase

This example works with SAXServlet included in this package to demonstrate how XML data is created, manipulated, and passed between a client and a servlet. This class accepts user input to define a stock trade transaction. XML data is generated and sent to StockServlet via a HTTP POST. The resulting XML data returned from StockServlet is parsed and displayed in the console.

Author:
Copyright (c) 2000 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
StockClient()
          Default constructor.
 
Method Summary
 void endDocument()
          Receive notification of the end of a document.
 void error(org.xml.sax.SAXParseException ex)
          Receive notification of a recoverable error.
 void fatalError(org.xml.sax.SAXParseException ex)
          Receive notification of a non-recoverable error.
static void main(java.lang.String[] args)
          Runs this example from the command line.
 void startDocument()
          Receive notification of the beginning of a document.
 void startElement(java.lang.String name, org.xml.sax.AttributeList attrs)
          Receive notification of the beginning of an element.
 void warning(org.xml.sax.SAXParseException ex)
          Receive notification of a warning.
 
Methods inherited from class org.xml.sax.HandlerBase
characters, endElement, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StockClient

public StockClient()
Default constructor.
Method Detail

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Receive notification of the end of a document.
Overrides:
endDocument in class org.xml.sax.HandlerBase

error

public void error(org.xml.sax.SAXParseException ex)
Receive notification of a recoverable error.
Overrides:
error in class org.xml.sax.HandlerBase

fatalError

public void fatalError(org.xml.sax.SAXParseException ex)
                throws org.xml.sax.SAXException
Receive notification of a non-recoverable error.
Overrides:
fatalError in class org.xml.sax.HandlerBase

main

public static void main(java.lang.String[] args)
Runs this example from the command line.

java xml.sax.StockClient t3://localhost:7001/stock BEAS

Parameters:
url - URL of the servlet such as http://localhost:7001/examplesWebApp/StockServlet

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Receive notification of the beginning of a document.
Overrides:
startDocument in class org.xml.sax.HandlerBase

startElement

public void startElement(java.lang.String name,
                         org.xml.sax.AttributeList attrs)
                  throws org.xml.sax.SAXException
Receive notification of the beginning of an element.
Overrides:
startElement in class org.xml.sax.HandlerBase

warning

public void warning(org.xml.sax.SAXParseException ex)
Receive notification of a warning.
Overrides:
warning in class org.xml.sax.HandlerBase

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

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