It would work if you put the setAttribute in the render method.
Remember that the portal should be able to render your portlet without having to call the action method (only based on render parameters).
Let's say it would work:
- you set the object as an attribute in the action phase
- the render phase of this portlet is called and displays the object.
- now you rerender the page (refresh or click on another portlet for example)
- it will call the render phase again (without having called the action phase that set the attibute) and your object will be null.
You must set render parameters, then in the render phase set the attribute.
O.K. I understand.
Unfortunately using the render parameters is not an option as they are limited to string objects. (My processAction fetches tabular data from a database represented by an ArrayList).
You should fetch your data from your render phase.