Learn all about the second version of the Java Portlet Specification (JSR ). In Version , the specification and the APIs more than doubled. The Java Portlet Specification addresses the requirements of aggregation, was approved by the Java Community Process in March as JSR This tutorial on JSR development provides an introduction to portlet programming as the reader is taken through the creation of a simple HelloWorld portlet.
|Published (Last):||12 October 2004|
|PDF File Size:||4.96 Mb|
|ePub File Size:||9.67 Mb|
|Price:||Free* [*Free Regsitration Required]|
The important feature in JSR is Inter portlet communication. Generally in the portlet transition state will always change from Action Phase to Render Phase when we perform actions.
It was completed in JCP version 2. Liferay Top Contributor Award Winner.
Java Portlet Specification – Wikipedia
Typical applications of portlet filters could include these:. If the returned content is not user specific, you should additionally set the cache control to public scope. Public render parameters allow sharing of request parameters across different portlets or other artifacts, like themes or portal pages in IBM WebSphere Portal.
In the second version, you specificatino set cookies, document head section elements for example, HTML ones such as meta, link, or style and HTTP headers such as application-specific Pragma headers.
This servlet, however, was then addressed directly and not through the portal framework, so it did not have the portlet state provided, nor was it under the security protection of the portal, as you can see in figure 4. To receive a serveResource call triggered by a resource URL, you need to either implement the new ResourceServingPortlet or extend GenericPortlet, which already implements the new interface.
As a result of this action, the portlet issues event A. The JSR specification demanded that portlet containers must invalidate the cache for each user interaction with a portlet render or action URLso that there could be only a single cache entry per portlet window and user.
It still requires that the portlet packages these resources in its WAR file in case the portal has not already loaded the resource. Listing 5 is an example of a filter that does some pre- and post-processing and provides the poftlet with a wrapped request. In the first version of the Java Portlet Specification, you could not serve dynamically generated resources directly through the portlet. We will provide early public drafts in order to get public feedback as early as possible.
In the first version of the Java Portlet Specification, you had only the option of including servlets or JSPs from the render life-cycle call.
The portlet can define localized names for the decoration using the resource bundle entry: Thus, you can issue XmlHttpRequests to ResourceURLs and, on the server side, pkrtlet complete access to the portlet context such as render parameter, portlet mode, window state, portlet preferences, and portlet session. The define objects tag is now enhanced and gives you the following additional variables beyond the request, response, portletConfig from the V1.
The expert group of JSR consists of all the major commercial and open-source portal developers, portlet bridge developers, and portlet framework developers. January Learn how and when to remove this template message. You indicate that your portlet requires a specific container runtime option in the deployment descriptor using the code shown in listing 7. This attribute is set on a request sppecification to a portlet, indicating the current portlet life-cycle phase of this request. We recommend that you specificatioh not change the cache scope programmatically, though, as it may be difficult for portlet containers to ensure that cache entries are invalidated correctly if your portlet mixes responses with cache scope public and private for the same user.
As a result of not encoding any state of the page and portlets on the page, you cannot count on getting the current render parameters, portlet mode, or window state in your portlet.
Standard portlet API
The portlet container can then provide you with this ETag in the request of the next render or serveResource call, indicating that it still has the cached content available, which can be revalidated. If this specification, or a future version of this specification, is included in a future version of a Java platform specification, porflet specification will remain available for use outside the platform specification, and will continue to be evolved outside the platform specification.
Some extension points require that the container supports this extension point for the jzr to take advantage of the extension. Here before portlet execute render phase it can send events to other portlets.
Introduction to JSR / Portlet Specification ~ Liferay Savvy
In this case, the portlet jse cannot add anything to the head section of the document, as the specificstion section is already written. We’ve already seen an example of such a container runtime setting: JSR defines a list of container runtime options that are all optional except for actionScopedRequestAttributes. Specifying the shared property enables the portal to use only one version of such shared resources per page.
This article provides an overview of the main new features in JSR and some examples of how to leverage these features. JSR support Ajax mechanism to communicate with server. In JSR was added another feature called serving resources with help of this we can serve the images, pdf and other content types to client. You had only the ability to provide an additional servlet that serves the Ajax fragment. This restriction was done because portlets are aggregated on a page and all concepts that assume that you are the only component on the page are not easily applied to the portlet programming model.
The Web Services for Remote Portlets specification defines a web service interface for accessing and interacting with interactive presentation-oriented web services.