Sun Microsystems Logo

 

 
 

Sun[tm] ONE Studio 4, Enterprise Edition for Java[tm] with Application Server 7 Tutorial
Becoming Familiar with the Sample
PREV PREV NEXT

 

If you are already familiar with the JDBC[tm] Simple sample application (it is the sample used in the Getting Started Guide of the application server), proceed to the next section, Creating a Session Bean with the EJB[tm] Builder.

The sample application that you will be using during this exercise consists of a web application module and an EJB module containing a single stateless session bean. The web and EJB modules are packaged in an Enterprise Application Archive (EAR) file. Although patterned after basic "Hello World" applications, this sample displays a greeting based on the user's input and the time of day. Since each greeting is recorded to a database table, the user also has the option to list all previously generated greetings.

The display greeting path through the application is represented by the yellow numbered steps in the following diagram while the greeting log display path through the application is represented by the lettered blue steps in the diagram.

When the user accesses the application, the first page of the application prompts the user to enter a name that will be displayed in a subsequent greeting page.

After entering a name and clicking on the Process button, the following page is displayed with the appropriate greeting for the time of day.

In the background, the GreeterDBServlet accessed the stateless session bean to determine the appropriate greeting ("morning", "afternoon" or "evening"). The GreeterDBServlet sets the appropriate greeting message in the request object of the servlet request and specifies a JavaServer Pages[tm] page to display the result.

The greeting is displayed. When the user elects to list all previously generated greetings, the GreeterDBLogDisplayServlet performs a select all on the database table of greetings and specifies a JSP[tm] page to display the result.


Proceed to Creating a Session Bean with the EJB Builder to create the stateless session bean from scratch.

PREV PREV NEXT