< Previous | Next >

Lesson 1.1: Import the required resources and set the target server

Before you begin, you need to import the required resources for this tutorial: a set of Web pages and a sample Derby database.

The main purpose of this tutorial is to teach you how to create a Web application that enables users to access and manipulate data in a database. The tutorial does not go into the detail of designing the look and feel of a Web site. Accordingly, the Web site design has been prepared for you already.

To complete this tutorial you will need to access an existing set of JavaServer Faces JSP files and a sample Derby database. These foundational Web pages and sample database are included in a ZIP file. This lesson will take you through the steps of importing the ZIP file so you can use the Web pages and the database. You will also set the target server for the dynamic Web project.

The Web pages and database that you will use for this tutorial are included in a ZIP file. To import the content of the ZIP file:

Import the sample project file

  1. Import the project. Switch to the Web perspective (Window > Open Perspective > Web).
    Important: Once the projects import into your workspace, the Workspace Migration wizard will open. Follow the instructions in the wizard to migrate the imported projects.
  2. In the Enterprise Explorer view of the Web perspective, ensure that your ClassifiedsTutorial project looks like the following image:
    Enterprise Explorer view.

Set the target server for the dynamic Web project

Setting the target server for the Web project enables you to test the resources that you will be creating in this tutorial.

To set the target server:

  1. In the Enterprise Explorer view of the Web perspective, right-click ClassifiedsTutorial and select Properties.
  2. In the properties list, click Server.
  3. In the Default server list, select the server that you want to use as the default. Click Apply.
  4. In the properties list, click Targeted Runtimes.
  5. In the Runtimes list, click the runtime that corresponds with the server that you selected. Click OK.
Note: If you do not see any servers listed in the Default server list, and you have installed server runtimes, it is possible the server needs to be configured. To configure a server, you can do the following:
  1. Right-click all_records.jsp file, then select click Run As > Run on Server.
  2. Choose Manually define a new server.
  3. Select a server you have installed.
  4. Follow the directions in the wizard to configure the server. The first time you run on server you may receive an error. To fix the error set the target server as described above, restart the server in the Servers view, and reload the Web page in the browser.
If you go back through the previously described steps for setting a target server, you will now find the default server is the one you have just configured. If a server is installed but not configured, it will not show up in the list of servers from which you can choose a default target.

Lesson checkpoint

You have now imported the ClassifiedsTutorial dynamic Web project and set the target server.

You can browse the files in the tutorial Web project. To open a file, double-click it in the Enterprise Explorer view. To view a map-like representation of how the pages are related, double-click Web Site Navigation in the Enterprise Explorer.

The majority of your work in this sample will involve the following files:
all_records.jsp
This is the site's home page. It will display every classified ad in the database.
new_record.jsp
This page will create a new classified ad.
update_record.jsp
This page will change the details about an ad in the database or delete it.
classifiedTemplate.jtpl
This is the template for the site pages. It includes elements like the table and the gray "Welcome to the Classifieds" banner that are on every page. This page also has two navigational tabs below the gray banner that lead to the home page and the new classified ads page.
Now you are ready to begin Exercise 1.2: Working with the relational record list and data table components.
< Previous | Next >

Feedback