Documentation‎ > ‎Portlets‎ > ‎



What is a portlet?
From an user perspective, portlet is a small window  that serves specific piece of content. A page can have multiple portlet windows. The igoogle is a sample site that shows a page with multiple portlet windows. Examples of portlets includes the one that shows stocks, weather, maps etc. From a developer perspective, portlet is single component that can be developed as a separate entity.

What is supported functionality of portal server software?
Here are the major features that are supported by Portal software vendors
  • Provide container to run portlets(JSR 286 complaint etc)
  • Allow users/administrators to customize page to have selected portlets
  • Provide Authorization for resources like portlets, pages
  • Aggregate contents from portlets located on user's requested page
  • Provide ability to customize themes to change appearance of portal for customer needs
  • Integrate with existing user repositories (LDAP or database)
  • Allow users to experience Single Sign On (SSO)
What is JSR 286?
The JSR 286 is a new specification extended on JSR 168 to develop standardized portlets that can be run on any portlet container complaint  with these specifications. For example, a portlet developed using JSR 286 APIs will run on Websphere Portal, Liferay Portal without needing any changes.

What are the differences between servlets and portlets?
The portlets are extension of servlets and both of them use same class loader. However, there are some differences and they are listed here.
  • The servlets serve whole documents where as portlets serve HTML fragments
  • Unlike servlets, portlets can not write the high level tags like html, body, head etc to the output stream.
  • Servlets can be interacted directly where as portlets must be invoked through portal system.
What are additional features of portlets?
Here are the list of features that are provided by portlets
  • Allow communication between portlets
  • Portlets have refined request phase to separate processing of HTML form from rendering contents.
  • Access to user profile
  • Persist user settings
What are portlet modes?
Portlet has a title bar that shows title and click-able links shown usually as icons on the right-hand side. These links allow user to select supported modes and window states of the portlet. The portlet specifications support view, edit, and help modes. By default, portlet content is shown in view mode. A link in the title bar of portlet can allow user to choose edit mode. Usually, the edit mode provides  a screen to display a form. Upon submission of the form, the data will be persisted. For example, stock portlet can provide edit mode to add stock symbols so that quotes for these stocks can be shown when portlet is in normal view mode. The settings in edit mode can be persisted so that user does not need to enter them for every login session.

What are portlet window states?
The window state of portlet decides how much space a portlet occupies on a page. Portlets can be shown in three window states.
  • The minimize state displays only title bar of portlet.
  • The maximize state causes single portlet to occupy whole page
  • The normal state allows portlets to co-exist with others on a page.