Developing the Servlet for loading and saving BTT On-Demand Workplace Area

About this task
There are two kinds of Servlets. One is for getting request of the Workplace XML structure. The other is for saving request dealing with the posted data of the Workplace XML structure string. Do the following steps to develop servlet for loading and saving BTT On-Demand Workplace Area:
  1. Make decisions for the storage means.

    As the Servlet is responsible for sending XML DOM structure as a response or restore the XML string, you can choose to use the file system or the database.

    In BTTWeb2InternetBankSample, the file system is implemented. So every user has his or her own XML files to store information of BTT On-Demand Workplace Area.

    using file system for the storage means

  2. Develop the Servlet using DOM or SAX or other XML technology to solve the XML string. Set the Servlet in the web project.

    The main responsibility of the Servlet is illustrated in the following figure:

    the main responsibility of the Servlet

    Develop a Servlet named BTTXMLRequest, which accepts a parameter file. The parameter specifies the file URL for the XML file. And use DOM to parse the XML file into XML string, which is sent back as a response.

    Remember to config the Servlet in web.xml as follows:

    config the Servlet in web.xml

  3. Set the Servlet URL.

    Do the configuration in BTTWeb20/Common/Config.js, where global variables are defined, including the Servlet URL and the required HTML element id.

    For example, BasicInfrasutrcture.xml is used for manageable element, and it is stored as the XML file named BasicInfrastructure.xml in the WebContent/BTTXML folder in the server deployment path. So configure it in BTTWeb20/Common/Config.js