Sun Microsystems Logo

 

 
 

Sun[tm] ONE Application Server 7
Becoming Familiar with the Sample Application
PREV START NEXT

 

The sample application that you will be using during this guide consists of a web application module and an EJB[tm] module containing a single stateless session bean. The web and EJB modules are packaged in an Enterprise Application Archive (EAR) file. Although patterned after more 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.

Sample Application 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.

Sample Main Page Screenshot

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.

Sample Greeting Display Screenshot

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.

Sample Greeting Log Screenshot

Proceed to Setting Up Database Connectivity to configure the application server's database setup to support deployment and execution of the sample.

PREV START NEXT