The following are important points extracted from the JSR 168 Portlet Specification for quick reference. Please download the Java API and specification from the above hyperlink for further details.
What is a Portal?
=> A web based application that commonly provides personalization, single sign on, content aggregation from different sources and hosts the presentation layer of Information Systems.
Portal pages may have different set of portlets creating content for different users.
What is a Portlet?
=> A Java technology based web component, managed by a portlet container, that processes requests and generates dynamic content.
Portlets are used by portals as pluggable user interface components that provide a presentation layer to Information System.
Lifecycle of portlet is managed by the portlet container.
Fragment => Content generated by a portlet. A piece of markup (eg. HTML, XHTML, XML) adhering to certain rules and can be aggregated with the content of other portlets to form the portal page. May vary from one user to another depending on the user configuration for the portlet.
Web clients interact with (usually the content produced by) portlets via a request/response paradigm implemented by the portal. Eg. by following a links or submitting forms -> portlet actions received by the portal, forwarded to the portlets targeted by user's interactions.
What is a Portlet Container?
=> runs portlets and provides them with the required runtime environment.
Contains portlets and manages their lifecycle. Also provides persistent storage for portlet preferences.
Receives requests from the portal to execute requests on the portlets hosted by it.
Not responsible for aggregating the content produced by the portlets (but portal's responsibility to handle it).
A portal and a portlet container can be built together as a simple component of an application suite or as two separate components of a portal application.
An Example
A typical sequence of events, initiated when users access the portal page:
- A client (eg. a web browser) after being authenticated makes an HTTP request to the portal
- The request is received by the portal
- The portal determines if the request contains an action targeted to any of the portlets associated with the portal page
- If there is an action targeted to a portlet, the portal requests the portlet container to invoke the portlet to process the action
- A portal invokes portlets, through the portlet container, to obtain content fragments that can be included in the resulting portal page
- The portal aggregates the output of the portlets in the portal page and sends the portal page back to the client