< Previous | Next >

Lesson 1.3: Test the Web site

When you are ready to publish your Web application, you will need a server that will host it so users can access the Web site through the Internet; however, to test your Web site, you can use a test environment.
In this lesson, you will run a JSP in a test environment to simulate what a page will look like when it is actually published. You will also learn how to start and stop a server. At any time during your Web site development, you can open a page in Page Designer and use the Preview tab to see how your design will look in a browser. However, the Preview view does not allow you to see the dynamic aspects of your page (such as database connections) as they would display running from a server.
Tip: Once you have started the server, you must stop it before you can continue working with the site.

To test the Web site on a server:

  1. In the Enterprise Explorer view, right-click all_records.jsp file, then select click Run As > Run on Server. The Run On Server window opens.
  2. You must use the same server as the one you chose to be the target server in Lesson 1.1. Using a different server in this step will create errors.
    • If you want to test the Web site on a previously defined server configuration:
      1. Select Choose an existing server.
      2. Select the server that you want to use from the list available.
    • If you want to test the Web site on a new server configuration:
      1. Select Manually define a new server.
      2. Select the server type that you want to use from the list available.
  3. Click Finish.

The server tools create the new server, start it, and open the page in the workbench internal Web browser. This may take a moment. In the Console view, you can watch the messages as the server tools start the server.

Once this process is complete, you can preview how the site will look and work once it is actually published to a Web server. Click the links, enter data in the forms, and see any dynamically generated content in the site that may not appear in Preview view. Also, if you wish to see your page in different Web browsers, you can copy the URL from the workbench Web browser into the browser of your choice.

You must stop the server before you can continue with the tutorial. If you leave the server running, you will see error messages when you continue with the tutorial. These errors appear because the server is connected to the sample database, preventing you from connecting to the database to change the information shown on the Web site.

To stop the server:
  1. Open the Servers view. This view is usually located at the bottom center of the workbench. If you are not able to find the Servers view, click Window > Show View > Servers from the main menu.
  2. Select the server that you want to stop. Notice that the server status is listed as Started.
    Server view.
  3. Click the Stop the server button at the top right of the Servers view. The server Status changes to Stopping. You will see messages in the Console view while the server shuts down. When the server Status in the Servers view changes to Stopped, the server is stopped and you can continue working on the Web site.
Tip: You can test your Web site on the server at any time, but remember to stop the server when you are finished.

Lesson checkpoint

You have completed Lesson 1.3. In this lesson, you tested a JSP in a test environment to simulate what your page will look like when it is actually published. You also learned how to start and stop a server.
< Previous | Next >

Feedback