Search This Blog

Thursday, November 17, 2016

How share arrtribute between processAction and render methods ?

1- Add following to portlet.xml

<container-runtime-option>
<name>javax.portlet.actionScopedRequestAttributes</name>
<value>true</value>
<value>numberOfCachedScopes</value>
<value>10</value>
</container-runtime-option>

2-  set the request object attributes on processAction

request.setAttribute("attr1", request.getParameter("attr1"));

3- read attribute value in render

request.getAttribute("attr1")