C H A P T E R  6

Tutorial--Section 1.3 Test Run the Login Page

This chapter describes how to run your Web Application Framework application.


Task 3: Test Run the Login Page

Compile the Web Application

1. Select the Application Name folder.


This figure shows the Application Name folder (Jato Tutorial) selected, that node's property sheet displayed, and the Deploy button in the toolbar clicked.

2. Click the Deploy button on the Web 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 Sun Java System Application Server in one step.

If you followed all of the tutorial instructions, the Web application compiles and deploys without error. See the IDE's 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 Sun Java System Application Server (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 Web 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 Web Application Framework toolbar) forces the Sun Java System Application Server to reload all resources (for example, JSP pages, classes, and so on). 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 - For some web browsers include certain version of Microsoft Internet Explorer, 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 a successful-login 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 with a failed-login message.

Alternative Runtime Environments

1. If you prefer to test run you application outside of the IDE, 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 IDE, as follows:

<studio-install-dir>\AppServer7\pointbase\client_tools\lib\pbclient42RE.jar for Windows.

<studio-install-dir>/AppServer7/pointbase/client_tools/lib/
pbclient42RE.jar
for Solaris/Linux.

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.