Description | |
---|---|
v1.0 | The initial code with everything in the run method. |
v1.1 | The business logic/application code is moved into a doRequest method. |
v1.2 | The request and response variables are grouped into Request and Response classes. |
v1.3 | The doRequest is removed for the HTTPServer class entirely into a subclass MainService . |
v2 | The Request and Response classes and the request and response handling methods are moved into dedicated RequestContext and ResponseContext classes. |
v3 | Split each service into its own class, and group the server code into its own package. |
v4 | Reorganize the server code so the server itself isn't a thread. Clients are handle by worker threads. |
v5 | Spin-off the service logic into model classes, engines, and data access objects. |
The Tomcat servlet versions:
The associated model classes:
- TotalService: Demonstrates accessing and setting the
session
.
- StartService: Demonstrates redirection, the
session
, querying request properties and initial parameters. - VendorIDtoNamesService: Demostrates the
session
, uses a TCP service via model (engine) class.- VendorIDtoNameTCPService: The TCP service.
- VendorsEngine: The model class (engine).
- ProductsAPIService: The Products API
- Product:
Model class for representing a record in the
Product
table in the database. - Products:
Model class for a collection of
Product
objects. - ProductFilter: Model class for storing parameters for the search filter.
- ProductsDAO: Database access object for CRUD operations into the database.
- ProductsAPIRequest:
Class to check and parse the JSON request bodies into
Product
andProducts
. - ProductsAPIResponse: Class to form well-structured JSON responses specific to the Products API.
- Product:
Model class for representing a record in the
-
- CartAPIRequest:
Class to check and parse the JSON request bodies into
ProductFilter
objects. - CartAPIResponse: Class to form well-structured JSON responses specific to the Cart API.
- CartAPIRequest:
Class to check and parse the JSON request bodies into
-
Shared:
- APIRequest: Class to deserialize the HTTP Request body as JSON.
- APIResponse: Class to form well-structured JSON responses.
- context.xml: Database configurations
To run, copy the cgi-bin directory into your www
directory and run: chmod -R go+x ~/www/cgi-bin/
.