Introduction
This sample code demonstrates using a thin client solution with MQSeries.
The scenario requirements is that a user fills out an HTML form. The user
data is collected from the form and sent via a message queue to the back
end application. The back end application will then process the form
data and send a reply back via the message queue. The reply needs
to be displayed in the browser.
The sample shows the interaction between a thin client, servlet and
message queue and demonstrates how different products offered by IBM can
be used in the solution.
Process flow
Software Requirements
IBM HTTP Server 3.0
WebSphere 2.02
JDK version 1.1.7
MQSeries version 5.0
Netscape or Internet Explorer 3.0 or later
Configuring the MQSeries Server
Configuring the WebSphere
Select Use System Classpath
? - No.
Make sure you have the servlets
directory and MQ's java classes in the class path.
In Application Server Classpath
- x:\..\..\WebSphere\AppServer\servlets; x:\..\mqm\java\lib;
Servlet Name - BillingAddressServlet
Class Name - com.ibm.toolbelt.BillingAddressServlet
Bean Servlet - No
Click on Test, and verify that the servlet is loaded successful.
Running the sample
In the NT services pane make sure the following services IBM HTTP Server,
WebSphere Servlet Service and IBM MQSeries are started. Open up a browser
window and invoke the AddressInputForm.html by typing http://localhost/AddressInputForm.html.
Fill out the information requested and click Submit.
The browser sends request to the BillingAddressServlet, which will
put the message on the queue. It then retrieves the message back
from the queue. The retrieved message is stored in the BillingAddressBean.
The servlet then invokes AddressOutputPage.jsp. Which then displays
the return message in the browser.
Note that the first time when you invoke the servlet, it take a lot
of time to get back the reply. Your browser may also time out, depending
on browser time out value. This is because WebSphere loads the servlet
in the memory. Also the AddressOutputPage.jsp is compiled into a
servlet and gets loaded in memory. However, subsequent calls to the
BillingAddressServlet are much faster since it is now loaded in memory
and readily available to execute the work.