JSR 286 PORTLET TUTORIAL PDF

Inter portlet communication is mechanism to send or receive data between two portlets. We can achieve IPC with different ways in portlets and we can make communication between portlet which are in same page or other pages too. We will use different ways based on our requirement. In JSR they made communication between portlet which are in different pages using other mechanism The following are new IPC mechanism added in JSR Events Public Render Parameters Events: Event based mechanism way to communicate between portlet which are in same or in other page too. Here one portlet will send the event and other portlet will listen the event. Here another method added in lifecycle so that it send or publish the events and when page render respective listener portlets receive the dada or events.

Author:Aragul Mezit
Country:Guadeloupe
Language:English (Spanish)
Genre:Education
Published (Last):22 September 2010
Pages:236
PDF File Size:2.43 Mb
ePub File Size:16.99 Mb
ISBN:216-7-15860-196-7
Downloads:29750
Price:Free* [*Free Regsitration Required]
Uploader:Gosar



Each filter interface extends a common base interface named javax. This common base interface contains two methods: init javax. FilterConfig filterConfig and destroy. The init method ensures that every filter has access to a FilterConfig object from which it can obtain its initialization parameters: a reference to the PortletContext that it can use, for example, to load resources needed for filtering tasks.

The destroy method signifies the end of service of the filter. The init and destroy methods of a portlet filter are called only once during their lifetime.

A single filter class can provide filter functionality for more than one lifecycle method. Also, a single filter can provide filter functionality for more than one portlet. Multiple filters can be associated with one lifecycle method of a portlet.

To write a portlet filter: Write a filter class. A filter class should implement one or more of the previously mentioned four interfaces and should provide a no argument public constructor. The filter class should also override the init and destroy methods of the javax.

PortletFilter interface. If you want the filter to be applied to all portlets in the application, you need to use an asterisk as a wildcard. The number of times the sample portlet has been accessed is logged using a filter.

Access the portlet and check the application server log file. The log file shows the number of times the portlet has been accessed. The cache was also per user client and not shared across users.

The Portlet 2. The default value is private, which behaves like the JSR caching where the cache is per user. The cache scope can also be changed programmatically using a response property, such as MimeResponse.

After the cache has expired, the portlet has the option to check if the cache is still valid and indicate that the cache can be reused. Once the cache has expired the portlet container calls the render or serveResource method with the ETag set in the RenderRequest or ResourceRequest, which the portlet can access to check if the cache is still valid. If the cache is still valid, then the portlet can set CacheControl. With the new features of public sharing of caches, resource caching, validation caching, and leveraging browser caching, the performance of an aggregation of portlets by a portal can be seen to increase significantly.

Element as the value. Following is the code snippet. Cookie cookie The cookie can then be accessed in all lifecycle methods using request. This allows you to dispatch to action or event logic written in a servlet or JSP. And when serving resources you can use the forward method.

For example, the portlet could use URL listeners to set the caching level of resource URLs in one central piece of code. Following are the runtime options that are defined in JSR javax. To be able to run these portlets on a JSR Portlet 2. The default for this setting is true. The default for this setting is false. Some portlets might require that the session variable of included or forwarded servlets or JSPs maps instead to the portlet session scope in order to work correctly.

These portlets can indicate this by setting the container-runtime-option javax. The default for javax. The portlet specification provides the render parameters for such use cases, but some applications need to transport complex objects instead of strings. For such use cases the portlet specification provides the action-scoped request attributes as a container runtime option. If this option is set to true, any complex object that is set as a request attribute in the action or event phase is available in the render phase.

These attributes can be accessed by the portlets until a new action occurs. To set request attributes as container runtime options: Add the container runtime option as shown here in the portlet. This means that all portlets written using the Portlet 1. The only exceptions to this rule are these: renderResponse. In JSR , it returned null.

ENDOCRINOLOGIA CLINICA VILAR PDF

JSR-286 development tutorial: An introduction to portlet programming

Each filter interface extends a common base interface named javax. This common base interface contains two methods: init javax. FilterConfig filterConfig and destroy. The init method ensures that every filter has access to a FilterConfig object from which it can obtain its initialization parameters: a reference to the PortletContext that it can use, for example, to load resources needed for filtering tasks.

EPOS O GILGAMESZU PDF

Java Portlet Example Tutorial

Overview Portlets are web-based components that enable integration between applications and portals and thus enable delivery of applications on portals. The Java Portlet Specification achieves interoperability among portlets and portals by defining the APIs for portlets. The Java Portlet Specification 1. This brought a world of difference. By adhering to the standards, you can build portlets that can run in portals, irrespective of their vendors. Since its release in , JSR has gone through many real-life tests in portal development and deployment.

DILIP SULTANIA DATA STRUCTURE PDF

JSR-286 Development Tutorial: JSPs, MVC and the portlet tag library

ActionResponse The ActionResponse represents the response for the response to an action request. To make clear, following sample shows you the difference in between calling render and processAction. IOException; import javax. ActionRequest; import javax. ActionResponse; import javax. GenericPortlet; import javax.

Related Articles