JSP pages in portlets should contain HTML fragments only. The portlet contributes its content to a larger page, so it cannot be a fully formed HTML page. Use the tags <dmf:html>, <dmf:head>, and <dmf:body> instead of <HTML>, <HEAD>, <TITLE>, or <BODY> elements. These tags will be rendered appropriately for portal environments. They enable icon rendition and error handling, so they should not be omitted from JSP pages that are used in portlets.
Your portlet content will probably be contained within a table cell (<TD>) on the portal page. You can use default width and height and add width and height preferences to your portlet XML configuration. The portlet will then use scroll bars if the content is too large for the available table space. Avoid unnecessary layout elements to reduce the amount of scrolling needed for your portlet.
Avoid placing <nobr> tags around table cells to prevent line breaks. This will cause your portlet to push the portal page wide and may force excessive scrolling when users view other portlets. To allow portal users with disabilities to be able to use your portlet, the JSPs should be fully enabled for keyboard-only control and other assistive technologies. For guidelines on making your portlet components accessible, refer to Web Development Kit and Client Applications Reference Guide.
Use Java comments rather than HTML comments (<! - comment ->) in your files. HTML comments are rendered into the output even though they are not visible, increasing the document size and download time. Java comments similar to the following example are removed from the rendered source along with Java code:
<% //this is a comment %>
Give each control in your portlet components a unique name, because they will be rendered by the portal container into a single HTML page.