Technical standard
TheJava Portlet Specification defines acontract between aportlet and itscontainer; it provides a convenientprogramming model forJava portletdevelopers. Multiple versions of the specification, each aJava Specification Request (JSR) document, have been released with each intended to define an improved technology compared to the previous version.
A Java portlet resembles a Javaservlet but produces fragments rather than complete documents, and is not bound by aURL.
Version 1.0 was developed under theJava Community Process asJSR 168 and released in its final form in October 2003.[1] It introduced the portlet programming model with:
- Two phases of action processing and rendering
- To support theModel–View–Controller pattern.
- Portlet modes
- Enabling the portal to advise the portlet what task it should perform and what content it should generate.
- Window states
- Indicating the amount of portal page space that will be assigned to the content generated by the portlet.
- Portlet data model
- Allowing the portlet to store view information in the render parameters, session related information in the portlet session and per user persistent data in the portlet preferences.
- Packaging format
- To group different portlets and otherJava EE artifacts needed by these portlets into one portlet application which can be deployed on the portal server.
- Portal development
- As a way to integrate the different web-based applications for supporting deliveries of information and services.
- Portlet catalog
- A set of ready-to-use components for a portal. Initially, Java portal vendors developed incompatible portlet frameworks and thus use of those portlets were confined to specific portal servers. With JSR 168, Java portlets could be developed for deployment on any conforming Java portal server. A catalog makes sure that portlets under this catalog may run on any standards–compliant Java portal server. Types of portlet solution (vertical domains and technology) like collaboration, social networking, community, content management, utility, calendaring, HRM all are available in these catalogs. There are many open source and commercial portlet catalogs available but JSR-168-based solutions are rare. JSR 168 offers suitability to the developers to reuse the code to maintain a set of JSR-168-compliant portlets.
JSR-286 is version 2, developed under theJCP and created in alignment with the updated version 2.0 ofWSRP. It was released in June 2008.[2] It was developed to improve on the short-comings of the version 1.0 specification, JSR-168. Some of its major features include:[3]
- Inter-portlet communication via events and public render parameters
- Serving dynamically generated resources directly
- ServingAJAX orJSON data directly
- Filters and listeners
JSR-362 is version 3, released in April 2017.[4] Some of its major features include:[5]
- Resource Dependencies
- Explicit Render State
- CDI 1.2 Integration
- Servlet 3.1 Alignment
- Portlet Hub & XHR IPC
- FacesBridge Integration via JSR 378[6]