The new portlet filter functionality allows you to plug filters around any life-cycle call of the portlet. Following the common decorator pattern, filters can do pre- or post-processing, and they can modify or wrap the request and response objects that are passed to the portlet. Typical applications of portlet filters could include these:
Passing information from additional sources to the portlet as attributes or parameters
Output filtering for security enforcement or markup compliance
Collecting diagnostic information
Bridging between Web application frameworks, for example, uses a filter approach to augment the markup of portlets with additional semantic information for client-side click-to-action.
The portlet filter programming model is modeled on the servlet filter model:
Define the filters in the deployment descriptor. This definition is done using the element, where you also need to state the life-cycle call to which the filter should be applied.
Implement the corresponding Filter interface in your filter. You can also list multiple life-cycle entries and implement multiple Filter interfaces with your class.
Provide a filter-mapping element where you describe to which portlets your filter should be applied (you can also use an asterisk as a wildcard if it should be applied to all portlets in the application).
The order of the filter-mapping elements in the deployment descriptor also defines the order of the filters that are applied to the portlet.
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
0 Comments:
Post a Comment