Chapter 6. Portlet development and deployment 243
.
Figure 6-53 Select servlet to assign to the portlet
Click on OK, then File->Save portlet.xml and Application Developer updates
the project and the Tasks listed for portlet.xml should have cleared.
2) Changing the HTML pages
Because WebSphere Portal aggregates multiple portlet JSPs into a single Web
page, any existing HTML pages need to be converted to JSPs containing only
page fragments that are rendered from the Portlet Java code. The Trader Web
application servlet had a single HTML page Logon.html that we converted, bit in
general this would need to be done for all HTML pages making up a Web
application. Figure 6-54 on page 244 shows the top page level tags in
Logon.html ready for deletion.
244 WebSphere Portal on z/OS
Figure 6-54 Deleting page level tags from the HTML
Figure 6-55 on page 245 shows the bottom page level tags in Logon.html ready
for deletion.
Chapter 6. Portlet development and deployment 245
Figure 6-55 Deleting page level tags from the HTML
The next to last step was to rename the HTML file from Logon.html to Logon.jsp
as seen in Figure 6-56 on page 246.
246 WebSphere Portal on z/OS
Figure 6-56 The newly renamed Logon.jsp
3) Changing JSPs
Next we need to modify the JSPs that were imported from the servlet.
WebSphere Portal aggregates multiple portlet JSPs into a single Web page, so
the portlet JSPs must consist only of page fragments. This means we need to
remove all page level HTML tags from the JSPs, for example:
򐂰 <!DOCTYPE HTML - ....>
򐂰 <HTML>, </HTML>
򐂰 <HEAD>, </HEAD>
򐂰 <BODY>, </BODY>, including <META> and <LINK>
򐂰 <TITLE>, </TITLE>
Application Developer will automatically generate the DOCTYPE mark up for
Web pages and JSPs and we needed to turn this off. Select
Window->Preferences, expand Web Tools and select Files, as shown in
Figure 6-57 on page 247.
Chapter 6. Portlet development and deployment 247
Figure 6-57 Remove insert DOCTYPE preference
Uncheck Insert this DOCTYPE, also Include GENERATOR in HTML source, and
click Apply followed by OK.
Next we modified JSPs Buy.jsp, CompanySelection.jsp, Quotes.jsp,
Sell.jsp
and TraderError.jsp to remove the page level tags. Using Buy.jsp as an
example of how to do this we opened the source frame for the JSP and
highlighted for deletion the tags above the <jsp:useBean...> tags as shown in
Figure 6-58 on page 248.

Get WebSphere Portal on z/OS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.