All Examples  XML Examples  This Package 

Class examples.xml.http.StockServlet


java.lang.Object

   |

   +----javax.servlet.GenericServlet

           |

           +----javax.servlet.http.HttpServlet

                   |

                   +----examples.xml.http.StockServlet


public class StockServlet
extends HttpServlet
This example shows how to pass XML data between a Java client and a servlet over HTTP. This class receives stock trade instructions from StockClient in the form of XML data. This class obtains an instance of TraderBean and perfoms the stock trades. The results of the trade are then pass back to StockClient in the form of XML data.

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

Constructor Index

 o StockServlet()

Method Index

 o doPost(HttpServletRequest, HttpServletResponse)
Handles HTTP POST requests
 o init(ServletConfig)
Initializes servlet.

Constructors

 o StockServlet

 public StockServlet()

Methods

 o init

 public synchronized void init(ServletConfig config) throws ServletException

Initializes servlet.

Parameters:
config - ServletConfig
Throws: ServletException
if there is a servlet problem
Overrides:
init in class GenericServlet
 o doPost

 public final void doPost(HttpServletRequest request,

                          HttpServletResponse response) throws ServletException, IOException

Handles HTTP POST requests

Parameters:
request - HttpServletRequest
response - HttpServletResponse
Throws: ServletException
if there is a servlet problem
Throws: IOException
if there is a I/O problem
Overrides:
doPost in class HttpServlet

All Examples  XML Examples  This Package