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.

Author: Zujora Tagis
Country: Dominican Republic
Language: English (Spanish)
Genre: Love
Published (Last): 27 October 2011
Pages: 276
PDF File Size: 1.73 Mb
ePub File Size: 19.63 Mb
ISBN: 818-1-26529-195-4
Downloads: 12566
Price: Free* [*Free Regsitration Required]
Uploader: Nezahn

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. GenericPortlet also lets you use the following annotations to make dispatching life-cycle calls soecification specific handler code easier:. Let’s start by looking into the details of the new resource URL.

Java Portlet Specification

This limitation, and many other things that didn’t make it into V1. A Java portlet resembles a Java Servletbut produces fragments rather than complete documents, and is not bound by a URL. 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, spfcification also need to clean up these entries yourself.

Defining a public render parameter is very similar to defining an event: This design point means that all portlets written against the V1. Share to Twitter Share to Facebook.

What’s new in the Java Portlet Specification V2.0 (JSR 286)?

Views Read Edit View history. You now need to include the new tag library with: As an incremental upgrade to the technology, we will be building on the last revision, version 1. A portlet responds to requests from a web client with and generates dynamic content. Unsourced material may be challenged and removed. Some extension points require that the container supports this extension point for the portlet to take advantage of the extension. These state changes, though, should be limited to private state of the portlet: First, you provide the general event definition, and then you reference this definition in the portlet section with tags that specify that the portlet can either receive or send this event.

These hook points, though, come with a cost, especially the request lifecycle listeners, which add significant processing overhead for each request. Why do we need this additional JAXB serialization? But we have many elegant web application frameworks.


One advantage of serving resources speciication 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. In our sample, there is a connection between Portlet 1 and Portlets 2 and 3 for this event. Since then, nearly all the vendors in the Java portal space, both commercial and open-source vendors, specfication implemented this standard, and developers have written portlets using the Java Portlet API.

In JSRall cache entries were private for each user. Note that setting the cacheability of a resource response makes sense only if you allow the response to be cached by specifying HTTP caching headers for the returned response. If you have portlets that are not customizable and don’t display different content for different users, such as a news-of-the-day portlet, then you get a cache entry for each user, even if all entries are the same. Validation-based specificatioh solves this dilemma: Tuesday, April 8, In most cases, the portlet code does not actually need to change whether a render parameter is public or private, so you can enable your portlet for coordination by simply declaring those parts of the view state information in the portlet.

Thus, the event broker calls the processEvent life cycle method introduced with version 2.

Standard portlet API

Full sppecification resources, which do not depend on interaction state. The QName and alias names are used to connect public render parameters of different portlets.

Specificatiob resource request has similar methods to the render request, but in addition it lets you get access to upload data. One example involves implementing a mapping of resources to shared IDs. The specificatlon also can enhance the cacheability of resources in other ways, for example by keeping track of the state changes on the client and re-rendering only the spedification affected by state changes. Another State in Portlet Lifecycle.

Typically, connections are defined explicitly at page creation time, or they are automatically inferred by the portal at runtime.

You need to register such a listener with the listener element in the portlet deployment descriptor, and your class needs to implement the PortalURLGenerationListener interface that specificatio a callback method for each type of portlet URLs: This article needs additional citations for verification. We will use different ways based on our requirement.


Here one portlet will send the event and other portlet will listen the event. The first approach allows more control and flexibility, while the second is easier to use.

The new portlet filter functionality allows you to plug filters around any life-cycle call of the portlet. If you want to provide the portlet with additional capabilities, set an object providing access to these capabilities as a request attribute.

What’s new in the Java Portlet Specification V (JSR )?

A JSR portlets catalog makes sure that portlets under this catalog may run on any standards—compliant Java portal server.

Here Portlets catalog are of use. Portlet Specification, Version 1. After doing specifictaion preprocessing, the filter implementation can either terminate the request processing or call the next element in the filter chain, passing in either the received request and response or additional wrappers. Thus, the portal does not have a chance to update other parts of the page where this information may be encoded; for example, in WebSphere Portal all URLs contain this information and so need to be updated.

How can the portlet get access to these public render parameters? You can specify a full QName for each event, or if you use the same namespace for many events, you can portlwt it as the default namespace and then specify only the local part of each event. In the first version of the Java Portlet Specification, the portlet could not contribute to sections of the portal page outside its portlet window.

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. In the second version, you can set cookies, document head section elements for example, HTML ones such as meta, link, jjsr style and HTTP headers such as application-specific Pragma headers. We’ve already pportlet an example of such a container runtime setting: Public render parameters allow sharing of request parameters across different portlets or other artifacts, like themes or portal pages in IBM WebSphere Portal.

Sign in or register to add and subscribe to comments.