Creating portlet JSP files
Use the Web Page wizard to create JSP files for your portlets.
Before creating a portlet JSP file, have a portlet project created in your workspace. The Web Page wizard will create the proper JSP file based on the context of your portlet project.
You will create additional portlet JSP files to add forms and other types of pages to your portlet application. To create a portlet JSP file:
- From within the Project Explorer, right-click on the name of your portlet project; then select
New | Other. In the New Wizard, expand the Web folder and select
Web Page. Click Next. The Web Page wizard will open.
- Specify a name for your JSP file.
- Click browse to select a folder or accept the default folder for your portlet project
- Choose Portlet JSP as the template.
- If you want to configure additional options for your new page, click the
Options button. Use the left pane of the window to supply any of the encoding, content type, and document type information that you would typically provide for a JSP file.
After you have configured options for your JSP file, click
- Document Markup - Supply any of the encoding content type, and document type information that you would typically provide for a JSP file.
- J2EE - Create init() and destroy() method stubs for the JSP file by selecting the appropriate check boxes, as applicable. Registering the JSP file as a servlet in the Web deployment descriptor is not applicable to portlets, so options related to the
Add to web.xml check box should be disabled. If they are enabled, clear the check box to disable them.
- Style Sheets - The style sheet option is disabled for portlets.
- Tag Libraries - Click the
Add button to locate a TLD file or a JAR file that contains a TLD file to can add tag libraries from a variety of sources.
Close. If you are creating a JSP for a Faces portlet then there are these additional options:
- For JSR 168, JSR 286, or IBM® API Faces portlets you may use the Portlet JSP tab on the Options page to specify the initial page to display.
- If you want the new JSP to be an initial page select the
Set as initial page check box.
- Next select the associated
Mode and
portlet.
- Click Finish.
Related concepts
JavaServer Faces portlet applications
Creating Faces portlets and projects
Creating portlets and portlet projects
Related tasks
Adding and updating Faces portlet modes for existing IBM portlets
Adding and updating Faces portlet modes
Testing and debugging portlets
Inserting images in portlet JSP files
Changing portlet modes using a Faces action
Changing a JSF portlet page without a JSF action
Accessing portlet API objects from Faces actions and components
Creating portlet projects (IBM portlet API)
Enabling AJAX proxy support for a portlet project