This section provides a description of the lifecycle of
an AJAX file upload request in a WebSphere® Multichannel
Bank Transformation Toolkit application.
AJAX file upload request lifecycle
Figure 1 shows the lifecycle of an
AJAX request in a WebSphere Multichannel
Bank Transformation Toolkit application.
Figure 1. Lifecycle of an AJAX file upload request made in
a WebSphere Multichannel
Bank Transformation Toolkit application.
The following list describes how an AJAX request is processed
in a
WebSphere Multichannel
Bank Transformation Toolkit application.
- A file upload request is made by a user and is then sent from
the browser to the server side. The file upload request contains
the following information: the current processor ID, session ID and
file upload data ID.
- The FileuploadServlet class receives the request
and assigns a thread to process the request. The FileuploadServlet class
also assembles the resources that are required to process the file
upload request, and then it delegates the service() method
to the thread.
- The thread processes the service() method, handles
the file upload request, creates a new channel driver, channel request/response
messages and a channel context.
- The Channel driver initializes the channel context, parses file
upload request data, and updates the channel context data.
- The AjaxHtmlRequestHandler checks whether the
request is a duplicated request, updates the channel context, and
loads the file upload operation. The file upload operation retrieves
the file upload data by using the ID of the file upload data, find
the real file handler implClass, then load the file handler and then
leverage file handler to finish the real file upload work
- File handler initializes parameters based on file upload request
data.
- Validates the file upload request, e.g check file size limitation
or extension, it depends on the real implementation.
- Saves the file stream to proper storage. E.g file system or database.
- Updates data in the processor context so that the file can be
accessed later.
- The AjaxHtmlPresentationHandler sends the response
message to the FileuploadServlet class, then routes
the response to the client browser.