concept ActionResponse in category java

This is an excerpt from Manning's book Portlets in Action.
In figure 2.8 you saw that the execution of the processAction method is followed by an invocation of the render method by the portlet container. In portlets, the render and processAction lifecycle methods aren’t designed to communicate with each other, resulting in a clear separation of responsibility between action processing and content generation. But in some cases, you may need to send data from the processAction method to a subsequent render method; you can do this either by using the javax.portlet.actionScopedRequestAttributes container-runtime option or by setting render parameters in the ActionResponse.
Render parameters are set using either of these two methods of ActionResponse object:
setRenderParameter(String key, String value) setRenderParameters(String key, String[] values)Render parameters set using ActionResponse objects are available to the subsequent render method via the RenderRequest object. As the signatures of setRenderParameter and setRenderParameters suggest, you can only pass String or String[] parameters to the subsequent render method. If you want to pass complex objects, you should use the javax.portlet.actionScopedRequestAttributes container-runtime option. The container-runtime options are specified in the portlet deployment descriptor using the <container-runtime> element.
So far we’ve only looked at creating links with URLs that invoke a portlet’s render and action methods. Because ActionResponse is the only portlet response object with redirection capability, we’ll create the Learn More About Wins link referring to the What’s New portlet’s action URL. When the Learn More About Wins link is clicked, the action method of the What’s New portlet is invoked, allowing the portlet to redirect the user to the Latest Wins page, as shown here: