Version of the Portlet Specification plans to align with J2EE , integrate other new JSRs relevant for the portlet, and align with the WSRP specification V Learn all about the second version of the Java Portlet Specification (JSR ). In Version , the specification and the APIs more than doubled. Version of the Java Portlet Specification extended the capabilities to was approved by the Java Community Process in March as JSR
|Published (Last):||5 April 2004|
|PDF File Size:||18.81 Mb|
|ePub File Size:||11.69 Mb|
|Price:||Free* [*Free Regsitration Required]|
Java Portlet Specification
In the second version, you can 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.
To support these use cases, JSR introduces the portlet-managed modes that are not known to the portal, but are managed by 2.0 portlet itself. The Java Portlet Specification defines a contract between the portlet container and portlets and provides a convenient programming jwr for Java portlet developers. Thus, portlets that want to contribute to the head section or to set a portlet title should turn on the two-part rendering feature with the setting shown in listing 3 in the portlet deployment descriptor.
If, for example, the request to the back-end server takes up 90 percent of the time to render the portlet, it does not make sense to use validation-based caching to save only the remaining 10 percent rendering time. Subscribe me to comment notifications.
If something has changed in the back-end system, then you produce new markup and set the setting to false. A portlet is managed by a portlet container. Java enterprise platform Java specification requests Web portals. You can set the path to your resource asID, as shown here: GenericPortlet also lets you use the following annotations to make dispatching life-cycle calls to specific handler code easier:.
This article provides an overview of the main new features in JSR and some examples of how to leverage these features. Public render parameters allow sharing of request parameters across different portlets or other artifacts, like themes or portal pages in IBM WebSphere Portal.
Note, however, that no life-cycle calls are defined around the portlet window, so if you use the portlet window ID for specifying namespace entries in a persistent data store, you also need to clean up these entries yourself. Render parameters, portlet mode, and window state fall into this category as some portal implementations, such as WebSphere Portal, store this information in the URL to support the ability to bookmark and the use of Back and Forward buttons in the browser.
This is one of the good features.
Therefore, the JSR specification lets you indicate for which portlet modes the portal should display UI controls as part of the render response using the method setNextPossiblePortletModes. These hook points, though, come with a cost, especially the request lifecycle listeners, which add significant processing overhead for each request.
This attribute is set on a request targeted to a portlet, indicating the current portlet life-cycle phase of this request. If this specification, or a future version of this specification, is included in a future version of a Java platform specification, this specification will remain available for use outside the platform specification, and will continue to be evolved outside the platform specification. Ideally, set the expiration time to a high value so that the markup is cached for a long time.
As a result of this action, the portlet issues event A. QNames are the mechanism for using unique names in XML; they also have a Java representation as the standard library class javax. Typically, following portley desktop metaphora portal page is displayed as a collection of non-overlapping portlet windows, where each portlet window displays a portlet.
What’s new in the Java Portlet Specification V2.0 (JSR 286)?
You had only the ability to provide an additional servlet that serves the Ajax fragment. Listing 4 shows an example for a deployment descriptor entry. This limitation had some disadvantages:. With the help of Ajax we can avoid render all portlets in page. We’ve already seen an example of such a container runtime setting: This extension now allows you to use the namespace to also crate namespace form IDs if, for example, your portlet is intended to be aggregated in a forms-based portal server.
Listing 5 is an example of a filter that does some pre- and post-processing and provides the portlet with a wrapped request. JSR defines a list of container runtime options that are all optional except for actionScopedRequestAttributes. As we have seen, JSR provides you with the means to serve resources directly using the portlet. A portlet can also set the cache scope programmatically using a response property or the new CacheControl interface.
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. Liferay Important Code Snippets. Typically, connections are defined explicitly at page creation time, or they are automatically inferred by the portal at runtime.
We will provide early public drafts in order to get public feedback as early as possible. On the other hand, you may want to respond quickly to changes in your back-end system and provide an updated view of the portlet.
Parameters that have the same key first get the resource parameter values merged and then either the private or public render parameter values, depending on whether the parameter key was declared as a public render parameter in portlet. Here one portlet will send the event and other portlet will listen the event. Spevification portlet programming model now provides you with events and public render parameters so that you can build larger composite applications out of your portlets and reuse your portlets in different scenarios.
One example involves implementing a mapping of resources to shared IDs.
Standard portlet API
The specification and the APIs more than doubled compared to version 1. The requirement areas we intend to address include, but are not limited to, the following: Subscribe To Posts Atom. One advantage of serving resources through a servlet is less overhead because the request does not have to pass through the additional portal framework, for example, when serving large media streams. How would you do this? This page was last edited on 21 Novemberat Using validation-based caching is beneficial only if the operations for creating the markup are expensive compared to the operations for checking the back-end state.
What’s new in the Java Portlet Specification V (JSR )?