• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
Best practices for developing portlets using JSR 168 and WebSphere Portal V5.1
Best practices: Developing portletsusing JSR 168 and WebSphere PortalV5.1.0.1
Stefan Hepper  Programming Model Architect, IBM WPLC DivisionMarshall Lamb Componentization Architect, IBM WPLC DivisionApril 24, 2006© Copyright International Business Machines Corporation 2004, 2006. All rightsreserved.1
 
Best practices for developing portlets using JSR 168 and WebSphere Portal V5.1
Table of contents
Overview.............................................................................................................................3Definitions...........................................................................................................................3Portlet entity....................................................................................................................3Portlet window................................................................................................................4Portlet application definition...........................................................................................4JSR 168 specific concepts...................................................................................................4Persistent state.................................................................................................................4Transient state.................................................................................................................5Portlet and servlet relationship........................................................................................5Supported extensions in WebSphere Portal V5.1.0.1.....................................................6Portlet design guidelines.....................................................................................................8Portlet application design principles...............................................................................8Portlet design principles..................................................................................................8Portlet development guidelines.........................................................................................10Portlet coding guidelines...............................................................................................10JSP coding guidelines....................................................................................................14Portlet packaging guidelines.........................................................................................16Configuration Data management..................................................................................17Session management.....................................................................................................17Internationalization........................................................................................................20Inter-portlet communication and data sharing..............................................................21Multiple markup support...............................................................................................23Performance considerations..........................................................................................23Security considerations.................................................................................................25Remote portlet considerations.......................................................................................26Portlet documentation...................................................................................................26Summary...........................................................................................................................26Resources..........................................................................................................................27Standards and specifications.........................................................................................27WebSphere Portal..........................................................................................................27Struts support for portal.................................................................................................27Related topics................................................................................................................28Accessibility standards..................................................................................................28About the authors..............................................................................................................292
 
Best practices for developing portlets using JSR 168 and WebSphere Portal V5.1
Overview
The first release of Java™ Portlet Specification, JSR 168, by the JavaCommunity Process (JCP), provides a standard for interoperability between portlets and portals. Portlets written to this portlet API can be deployed on any JSR 168compliant portal and run out-of-the-box.The portlet architecture is an extension to the Java Servlet architecture. Therefore, manyaspects of portlet development are common to typical Web application development.However, the unique aspects of a portal add complexity to the application model, such as:
 
Multiple portlets per Web page
 
Portlet URL addressing
 
Portlet page flow control
 
User interface rendering restrictions
 
Inter-portlet communicationYou need to carefully consider the design of a portlet to take advantage of portal featuresinstead of falling prey to its complexity. By following the best practices outlined in thisdocument your portlets will be portable, maintainable, and will perform optimally.This document is a collection of best practices for portlet developers who want their  portlets to conform to, and to leverage the IBM® WebSphere® Portal infrastructure for,JSR 168. Divided into major categories, you can use these coding guidelines whendesigning and developing JSR 168 portlets for WebSphere Portal. It is not a primer for  portlet development, because it does not address the fundamentals of portlet programming. Instead, use it as a checklist during design and code reviews to help promote consistent and quality portlet implementations.Refer to theWebSphere Portal V5.1.0.1 InfoCenter and thePortlet Development Guide  for more information on developing portlets. See also theResourceslisted at the end of this article, including references for JSR 168.
Definitions
This section covers the basic definitions you need to understand in order to program JSR 168 portlets.
Portlet entity 
A portlet entity is a Java instance of a portlet parameterized with additional settings, a pattern known as the
 flyweight 
pattern. See
 Design Pattern
inResources. The3
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...