Creating a page template file

Creating a page template file involves:

  1. Creating a .jtpl page template file in your Web project.
  2. Adding content to the page template file.
  1. Create a .jtpl page template file in your Web project.
    1. Expand the project within the Web perspective and right-click WebContent.
    2. Select New > Other > Web > Page Template File to open the New Page Template File wizard.
    3. Enter a file name for the new page template file in the File Name field.
    4. Select Template containing iSeries Web Components Tag Library from the list in the Model field.
    5. Select the Configure advanced options check box and click Next.
    6. Leave the entries on the Tag Libraries page as is, and click Next.
    7. The Master.css style sheet and the iSeriesWebComponents.css style sheet files are listed by default in the Style Sheet field. This indicates that the style sheets are linked to the new page template file. All JSP files that are created using this page template file will also contain links to these style sheets. The style definitions in the style sheet files are applied to the JSP files and to the iSeries Web components that are added to those files, respectively.
    8. Click Finish to create the page template file.

      The page template file appears under the WebContent folder and it also opens in the editor view. A content area is automatically included in the file. This content area of the page template is reserved for the content that you add to a JSP file that uses this new page template file.

  2. Add content to the page template file.

    The following description is a simple illustration of updating the content of the page template file by adding a heading. For information about the many design elements that you can add to your file, search the online information for Page Designer. (The Page Designer editor provides the capability to apply a wide range of design elements to your files.)

    1. Click the Design tab in the editor view.
    2. Replace the default text that appears at the top of the page with My Company.
    3. With the cursor still on that line, specify Heading 1 from the Paragraph types in the Properties view at the bottom of the Web perspective, and select Center for Alignment.
    4. Save and close your updated page template file by selecting File > Close.
Restriction: To avoid problems in running the iSeries Web Interaction wizard, do not insert a form or an iSeries Web component in a page template file that you intend to apply to the input and output JSP pages of an iSeries Web application.
Note: A template containing iSeries Web Component Tag Library cannot be created with the Create from page template option checked. When Template containing iSeries Web Components Tag Library is selected as the model, the Create from page template option is disabled. Once you have created a page template using Template containing iSeries Web Components Tag Library, you can create a nested template using Template containing JSP as the model.