WAS v8.5 > Develop applications > Develop Portlet applications > Portlet aggregation and preferencesPortlet aggregation using JSP
The aggregation tag library generates a portlet aggregation framework to address one or more portlets on one page If we write JSP, we can aggregate multiple portlets on one page using the aggregation tag library. This tag library does not provide full featured portal aggregation implementation, but provides a good migration scenario if you already have aggregating servlets and JSP and want to switch to portlets.
To allow the customer to create a simple portal aggregation, the aggregation tag library also provides the following features.
- Invoke a portlet's action method
- Render multiple portlets on one page
- Provide links to change the portlet's mode or window state
- Display the portlet's title
- Retain the portlet cookie state
The aggregation tag library and JSP that use the aggregation tag library will only work with the WebSphere Application Server portlet container implementation because the protocol between the tags and the container is not standardized.
The following diagram depicts how an HTML page would look like and what tags are used in order to create the page.
Refer to the Aggregation tag library attributes article for information on the aggregation tag library attributes.
When we use the aggregation tag library, set the portletUrlPrefix attribute of the init tag to the aggregating application. You need to:
- Ensure the portletUrlPrefix attribute is set to the following in the aggregator page.
"http://" + <server_address> + ":" + <server_port> + "/" + <aggregator context> + "/" <aggregator mapping>
- Reference the aggregation JSP page within web.xml through a servlet mapping ending with /*. For example, /aggregation/*
When aggregating multiple portlets on a single page, special care must be used with the naming conventions of form attribute names in your portlets. Because your portlets are all on the same page, they all share the same HttpServletRequest. When one portlet is viewed the entire page is refreshed and form data is re-posted. If there are multiple portlets that are aggregated on a single page with the same form attribute names, there could be logic corruption when form data is re-posted.
Subtopics
- Aggregation tag library attributes
The aggregation tag library is used to aggregate multiple portlets on one page. This topic describes the attributes within the aggregation tag library.- Example: Using the portlet aggregation tag library
We can use the aggregation tag library to aggregate multiple portlets to have multiple and different content on one page. The library can be used by every JSP file that has been included by a servlet.- Aggregation tag library attributes
The aggregation tag library is used to aggregate multiple portlets on one page. This topic describes the attributes within the aggregation tag library.- Example: Using the portlet aggregation tag library
We can use the aggregation tag library to aggregate multiple portlets to have multiple and different content on one page. The library can be used by every JSP file that has been included by a servlet.
Related
Tasks: Managing portlets
Reference:
Portlet container settings