All Examples XML Examples This Package
Class examples.xml.http.StockClient
java.lang.Object
|
+----org.xml.sax.HandlerBase
|
+----examples.xml.http.StockClient
- public class StockClient
- extends 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.
-
StockClient()
- Default constructor.
-
endDocument()
- End document.
-
error(SAXParseException)
- Error.
-
fatalError(SAXParseException)
- Fatal error.
-
main(String[])
- Runs this exmaple from the command line.
-
startDocument()
- Start document.
-
startElement(String, AttributeList)
- Start element.
-
warning(SAXParseException)
- Warning.
StockClient
public StockClient()
- Default constructor.
main
public static void main(String args[])
- Runs this exmaple from the command line.
java examples.xml.sax.StockClient t3://localhost:7001/stock BEAS
- Parameters:
- url - URL of the servlet such as "http://localhost:7001/SAXStockServlet"
startDocument
public void startDocument() throws SAXException
- Start document.
- Overrides:
- startDocument in class HandlerBase
startElement
public void startElement(String name,
AttributeList attrs) throws SAXException
- Start element.
- Overrides:
- startElement in class HandlerBase
endDocument
public void endDocument() throws SAXException
- End document.
- Overrides:
- endDocument in class HandlerBase
warning
public void warning(SAXParseException ex)
- Warning.
- Overrides:
- warning in class HandlerBase
error
public void error(SAXParseException ex)
- Error.
- Overrides:
- error in class HandlerBase
fatalError
public void fatalError(SAXParseException ex) throws SAXException
- Fatal error.
- Overrides:
- fatalError in class HandlerBase
All Examples XML Examples This Package