The AjaxRequestServlet class extends the CSReqServlet class and is the point of entry for an AJAX request. The AjaxRequestServlet class uses the functions that are contained in the BTTChannelDriver class.
The file upload servlet is an AJAX servlet that handles file upload requests. Like the AjaxRequestServlet class, the FileuploadServlet class extends the CSReqServlet class, and it is the point of entry for a file upload request. The FileuploadServlet class uses the functions that are contained in the BTTChannelDriver class.
The BTTChannelDriver class implements the ChannelDriver interface, and it delegates the request operation process. The BTTChannelDriver class has the following functions:
▪ Initializes the channel parameters such as the device type and creates request handlers if the request handlers do not already exist.
▪ Parses the request header and the request data, and generates channel-specific data that is required to process a request.
▪ Initializes and assembles the policy handler.
▪ Invokes the request handler that is required to process the request.
The AjaxChannelRequest class implements the HttpChannelRequest interface and defines how AJAX request data is parsed. The AjaxChannelRequest class also generates data that is required by the AJAX channel to process an AJAX request.
The AjaxRequestHandler extends the HtmlRequestHandler, and it defines how AJAX request logic is handled. The AjaxRequestHandler has the following functions:
▪ AJAX request validation: when an HTTP request is made, the AjaxRequestHandler handler determines whether the request is an HTML channel request or an AJAX channel request.
▪ Initializes channel parameters and generates data that is required by the AJAX channel to process an AJAX request.
▪ Concurrent request support: enables two or more requests to be executed at the same time in a session.
▪ AJAX time out value: specifies how long an AJAX request will be timeout.
▪ Context handling: when a request is made, the AjaxRequestHandler methodrebuilds the current context. If a request is raised in a processor, the AjaxRequestHandler method rebuilds the processor context and chains the request operation context to the processor context so that the operation can access the processor context. If a request is not raised in a processor, the AjaxRequestHandler method chains the AJAX operation context under the current session context. When a request has been processed, the AjaxRequestHandler method unchains the operation context from the parent context. If the request is the last active request and the parent is a process, it will save the processor context in the cache as html processor done.
The AjaxHtmlPresentationHandler class extends the HtmlPresentationHandler class. Unlike the HTML presentation handler, the response message of the AJAX presentation handler is a formatted JSON string. A client browser handles the string as a JSON object for rendering.