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.
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 - ....>
<BODY>, </BODY>, including <META> and <LINK>
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,
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.