C H A P T E R  6

Tutorial--Section 1.3
Test Run the Login Page

This chapter describes how to run your Suntrademark ONE Application Framework application.


Task 3: Test Run the Login Page

Compile the Web Application

1. Select the Application Name folder.

This figure shows the selected Application Name folder option. 

2. Click the Deploy button on the Sun ONE Application Framework toolbar at the top of the Explorer window.

This compiles the entire Web application (those classes that need to be compiled) and deploys it to the Suntrademark ONE Application Server in one step.

If you followed all of the tutorial instructions, the Web application compiles and deploys without error. See the Suntrademark ONE Studio Output window for error messages.

This deployment step is required for any change you make to any of the resources in your Web application when running it in the Suntrademark ONE Application Server 7 (Application Server).

Test Run the Login Page

1. Select LoginPage.

This figure shows the selected LoginPage option. 

2. Click the Execute Page button located on the Sun ONE Application Framework toolbar at the top of the Explorer window.



Note - The Execute Page (Redeploy) button (just to the right of the Execute button on the Sun ONE Application Framework toolbar) forces the Sun ONE Application Server to reload all resources (for example, JSPs, classes, and so on). It actually restarts the Sun ONE Application Server. This is necessary if the Sun ONE Application Server must be restarted to pick up the new changes so that it does not use objects in memory.

For some browsers, you might have to close all instances of that browser before you can rerun any page in your application.



A default browser starts the application.

Test a Successful Login

1. Enter a valid login (for example, 1, 777, or 410 are valid (hard-coded) customer numbers).

2. Click Login.



Caution - If you press the enter key while in the text field, the form is submitted for you. However, the server does not know which button to address from this submit action. The <jato:form> tag provides an attribute defaultCommandChild that can be used to tell the server which button should be activated in the default case.

Refer to the tag library documentation for more information on this feature.

However, for now, just click the button directly.



The login page should refresh displaying the success message.

This figure shows the login page with the success message. 

Test an Unsuccessful Login

1. Enter an invalid login name (for example, foo, 8, or 14 - anything other than the valid, hard-coded customer numbers described above).

2. Click Login.

The login page should refresh displaying the failure message

This figure shows the login page displaying the failure message. 

Alternative Runtime Environments

1. If you prefer to test run you application outside of the Sun ONE Studio, compile and package your application into a WAR file and place the WAR file in the webapps directory (this varies from container to container, but most call it webapps).

2. You need to add the PointBase driver file to the servlet container's classpath. The driver can be found in the installation directory of the Sun ONE Studio, as follows:

<studio-install-dir>/appserver7/pointbase/server/lib/pbserver42RE.jar

The easiest way to accomplish this is to copy this driver to your application's web-inf/lib directory.

3. Open a browser and run it with the URL appropriate to the servlet container.

The only possible variation is the page name (LoginPage) at the end of the URL.

Apache Tomcat or Caucho Resin servlet containers: http://localhost:8080/JatoTutorial/main/LoginPage



Note - You might find it necessary to refer to this task again during this tutorial.