Java Portlet Specification
| Company type | Technical specification |
|---|---|
| Industry | Software development, Web portals |
| Founded | October 2003 |
Area served | Worldwide |
| Products | Portlet programming models and APIs (JSR 168, JSR 286, JSR 362) |
A Java Portlet Specification establishes a formal agreement between portlets and their containers, delivering a simplified programming model tailored for Java portlet developers. This specification is defined through several Java Specification Requests (JSRs).
Portlets
A portlet represents a modular user interface software component that is controlled and rendered inside a web portal. Portlets are responsible for producing dynamic content based on requests from web clients. Typical examples of portlet applications include e-mail, weather updates, discussion forums, and news services.
Portlet containers
Portlet containers oversee portlets by supplying the necessary runtime environment for their execution. They handle requests forwarded by the portal to perform actions on the deployed portlets.
Specifications
Portlet standards define platform-neutral application programming interfaces that empower developers to build portlets compatible with any compliant portal system. The Java Portlet Specification exemplifies this approach. In contrast to Java Servlets, Java portlets generate content fragments rather than complete documents and are not directly tied to URLs. Each Java Portlet Specification (JSR) outlines an agreement between portlets and their container, providing a practical programming framework for developers.
JSR 168
The inaugural Java Portlet Specification version 1.0, created through the Java Community Process as Java Specification Request JSR 168, was completed in October 2003.
JSR 168 introduced the essential portlet programming paradigm, which includes:
- Two distinct processing phases—action and rendering—supporting the Model–View–Controller design pattern.
- Portlet modes that enable portals to instruct portlets on specific tasks and content creation.
- Window states that represent the amount of portal page space assigned to portlet content.
- A data model accommodating view-related information within render parameters, session data stored in portlet sessions, and persistent user-specific preferences.
- A packaging mechanism allowing multiple portlets and associated Java EE components to be bundled into deployable portlet applications.
- Portal development as a method to integrate varied web-based applications delivering both information and services.
Portlet Catalog
- Prior to JSR 168, Java portal providers utilized proprietary portlet frameworks, restricting portlet deployment to their own portal servers. The introduction of JSR 168 enabled Java portlets to be deployed across any Java portal server adhering to this standard.
- A Portlets Catalog supplies prebuilt portlet components essential for enterprise portals, offering a wide selection across sectors such as collaboration, social networking, content management, utilities, calendaring, and human resource management.
- Portlet catalogs based on JSR 168 guarantee interoperability among all standards-compliant Java portal servers, simplifying deployment and ongoing maintenance.
- Although numerous open source and commercial portlet catalogs are available, only a limited number fully comply with JSR 168 specifications.
- JSR 168 facilitates efficient code reuse for developers and allows deployers to maintain a unified solution set deployable on multiple platforms.
JSR 286
JSR-286 (Java Portlet Specification version 2.0), published in June 2008 through the JCP, corresponds with the 2.0 release of WSRP. This specification overcomes the constraints found in JSR-168 by introducing capabilities such as:
- Event-driven Inter-Portlet Communication and public render parameters
- Direct handling of dynamically produced resources within portlets
- Delivery of AJAX and JSON content directly from portlets
- New support for portlet filters and event listeners
JSR 362
JSR-362 (Java Portlet Specification version 3.0), made available in April 2017, advances the standard by incorporating:
- Management of resource dependencies
- Precise control over Render State
- Integration with CDI 1.2 for dependency injection
- Compliance with Servlet 3.1 standards
- Implementation of Portlet Hub and XHR-based Inter-Portlet Communication (IPC)
- Support for FacesBridge through JSR 378
See also
External links
- JSR 301 (Portlet 1.0 Bridge for JavaServer Faces 1.2 Specification)
- JSR 329 (Portlet 2.0 Bridge for JSF 1.2 Specification)
- Apache’s JSR 168 Open Source Reference Implementation
- Archived open source JSR 168/WSRP community at java.net