Exercise 4.2: Creating a dynamic Web project

Before you begin, you must complete Exercise 4.1: Opening the Web perspective.

Web projects hold all of the Web resources that are created and used when developing your Web application. The first step to creating or importing a Web application is to create either a static or a dynamic Web project. Static Web projects are meant to contain only simple Web site resources, such as HTML files. Dynamic Web projects are used to structure Web applications that will use more complicated, dynamic Web technologies, such as JavaServer Page files, and possibly data access resources.

To create a dynamic Web project:

  1. Click File > New on the workbench menu.
  2. Then click Dynamic Web Project on the pop-up menu.
    Dynamic Web Project

    This starts the Dynamic Web Project wizard. The initial page of the wizard opens.
    Project name

  3. Accept the default value in the Project location field.

    This is where your project is stored in your file system.

  4. In the Project name field, type WSSLABxx.
  5. Click Show Advanced to specify the servlet version of your Web project.
  6. Leave the Servlet version as 2.4.
  7. Leave the Target server as WebSphere Application Server v6.0.
    Project name
  8. Click New next to the EAR project field.
  9. Click Show Advanced to specify the J2EE version of your Web project.

    These options allows you to specify the J2EE version for the Web project. If you plan to use the WebSphere Application Server Version 6 only, then you select J2EE version 1.4. If you are using previous versions of WebSphere Application Server in your environment and are planning to deploy the Web application to these versions then you use J2EE version 1.3 or 1.2 since these earlier versions of WebSphere Application Server don't support the J2EE version 1.4. In this exercise you use the Web application in the WebSphere Application Server (also known as the WebSphere Test Environment), which is Version 6.0, so you use J2EE version 1.4 which is the default.
    Page to select JSP level

  10. Leave the default value for the Name field.

    A new or existing Enterprise Application project must be associated with your new Web project for purposes of deployment.

    The Enterprise Application project is new, so you typed the name of the new project. When your Web project is created at the end of the wizard, the new Enterprise Application project (EAR file) is also created. The default is an Enterprise Application project named DefaultEAR located in the same directory as your new Web project.

  11. Leave the default value in the J2EE version list.

    By default, the Web project's J2EE level is set to the Workbench's J2EE version.

    Any new servlets and JSP files that you create should adhere to the latest specification level available; previous specification levels are offered to accommodate any legacy dynamic elements that you expect to import into the project.

  12. Click Finish on the Enterprise Application Project page.
  13. Click Next.

    The Features page opens.
    Features page

  14. Leave the Default style sheet (CSS) check box selected to create a default CSS file (called Master.css) for any HTML and JSP files included in the project.
  15. Select the iSeries Web Components Tag Library check box as you want to add iSeries fields and controls to the Web pages of your Web application.
  16. Select the Struts check box as you want to create a project that uses Struts technology.
  17. Leave the Web Diagram check box selected to create a Web diagram in the project.
  18. Click Next to go to the Select a Page Template for the Web Site page.
    Struts page
  19. Select the Use a default Page Template for the Web site check box.
  20. Click the A_blue.htpl thumbnail.
  21. Click Next.
  22. On the Struts Settings page, ensure that Create a Resource Bundle is selected. If not, select the Override default settings check box and then select Create a Resource Bundle for the Struts project.
    Struts page
  23. Click Finish to create the Web project.

    Now you are back in the workbench and your new project and project files appear in the Project Explorer.
    J2EE Navigator view with your project files

You know the difference between a static Web project and a dynamic Web project and have set up a dynamic Web project and now you are ready to begin Exercise 4.3: Setting up the iSeries server information.