There are two kinds of Servlet. One is for getting request of BTT
Workplace Area XML structure. The other is for getting post data of BTT Workplace
Area XML structure string and dealing with it.
- 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 either the file system or the database.
In
BTTWeb2InternetBankSample, the file system is chosen to be implemented. So
every user has his or her own XML file to store information of BTT On-Demand
Workplace Area.
- Develop 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.
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 like
the following block of code:
- Set the Servlet URL
Do 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 under WebContent/BTTXML folder in the server deployment path. So config this in BTTWeb20/Common/Config.js