Best Practices for Applying AJAX to JSR 168 Portlets Maintaining Portlet State, Using a JavaScript Library and More
Staff engineer at Sun, Greg Ziebold, and writer Marina Sum, present a technical article on the Sun Developer Network (SDN) on how to use AJAX in portlets that comply with the JavaTM Specification Request (JSR) 168: Portlet Specification.
JSR 168 defines a set of APIs for Portal computing addressing the areas of aggregation, personalization, presentation and security.
The tech tip explains the problem with using AJAX with JSR 168 portlets currently, which is that you cannot make asynchronous calls to portlets through portlet URLs (see an image of the problem). Until Portlet Specification 2.0 (JSR 286) offers better solutions, there is another way:
"Because a portlet is a Web application that can contain other resources, such as servlets and JSP pages, you can make the asynchronous requests to the resources that are bundled with the portlet. For instance, the Invoice Viewer sample includes a servlet that you can call to asynchronously render new content in the portlet. To take maximum advantage of this flexibility, the portlet and the servlet should be able to share information between themselves." The authors explain how to make that happen.
Customized news reports about Sun Microsystems. Just the news you need, none of what you don't. 50,000+ Members. 20,000+ Articles Published since 1998.