The sample application requests input, appends the input to a standard
message, and displays the resulting string. The sample consists of:
- An HTML form.
- A Java™ servlet, plus JavaServer Pages (JSPs), running in a J2EE-compliant
Web application server.
- An enterprise bean running on a CICS EJB server.
The sample works like this:
- The user starts the application from a Web browser. A form is displayed.
- The form asks the user to input a phrase. When the user presses the SUBMIT
button, the servlet is invoked.
- The servlet:
- Looks up a reference to the enterprise bean in the JNDI namespace
- Creates a new remote instance of the enterprise bean in CICS
- Invokes a method on the bean-instance, passing as input the phrase input
by the user
- The enterprise bean appends the user's phrase to the string “You
said ” and returns the result to the servlet.
- The servlet uses a JavaServer Page to display the result on the user's
browser.
Figure 1 shows the components of the sample application.
Figure 1. Overview
of the EJB “Hello World” sample application.
The main elements
of the sample are a Java servlet and an enterprise bean. In this example,
the servlet is running in a Web application server on a Windows NT server;
a COS Naming Server is used. Other configurations are possible. For example,
an LDAP name server could have been used; or the COS Naming Server might not
have been hosted in the same application server as the servlet.