Creating portlet JSP files

You can create and edit a portlet JSP files used in your portlet applications.

Note: If you are creating a Faces portlet JSP, refer to Creating Faces portlet JSP files. If you are creating a Struts portlet JSP, refer to Creating Struts portlet JSP files.

To create a new portlet JSP file,...

  1. Select File > New > JSP File. The New JSP File wizard opens.

  2. Select a Folder as the appropriate container for the file.

    The folder should be under the WebContent folder of the portlet project. If a JSP file is not under this folder, then it will not be included in the WAR file that is deployed to the server. In addition, link validation will not encompass files that are not under the WebContent folder.

  3. Type a File Name.

  4. Ensure that the appropriate option is displayed in the Markup Language drop-down list.

  5. Select Portlet JSP in the Model field. Because the JSP file is created within the context of a specific project, any file that you create will inherit the API-type and code model capabilities associated with the project.

  6. If you want to customize the file options, select the Configure advanced options check box and click Next. Otherwise, click Finish to create the portlet JSP file.

  7. Depending on the target portlet project, the default portlet tag library URI should already be included in the Tag Libraries page: /WEB-INF/tld/portlet.tld for IBM portlet projects, or http://java.sun.com/portlet for JSR 168 portlet projects. To insert tag library directives, click the Add button to open the Select a Tag Library dialog and select the tag libraries to insert. You must specify a Prefix value. Click OK.

  8. Optionally, click Next to add further properties to the JSP file.

  9. Click Finish to create the portlet JSP file.

The newly-created JSP file is created and opened in Page Designer.

 

Related tasks

Creating Faces portlet JSP files
Creating Struts portlet JSP files