Fórum

Liferay : Understanding the execution of Action Phase and Render Phase

Ravi Kiran, modificado 11 Anos atrás.

Liferay : Understanding the execution of Action Phase and Render Phase

Junior Member Postagens: 98 Data de Entrada: 12/12/11 Postagens Recentes
I am using Liferay 6 for the Portal Development .

By going through Liferay developer Guide the author explains that there are Two phases of Portlet Execution

Action Phase
Render Phase

public class DateTimePortlet extends GenericPortlet {

public void doView(RenderRequest req, RenderResponse res) throws IOException, PortletException {
Object actionAttribute = req.getAttribute("datetime");
res.getWriter().println("Date Time:" + (actionAttribute != null ? actionAttribute :"Unavailable"));
res.getWriter().println("<BR/>");
PortletURL u = res.createActionURL();
res.getWriter().println("<A href=" + u + ">Trigger an action.");
res.getWriter().close();
}

public void processAction(ActionRequest req, ActionResponse res) throws PortletException {
req.setAttribute("datetime",new Date());
}

}


What my understanding is that , the doView method is known as Render Phase and the processAction Method is known as Action Phase . And if there are 5 portlets displayed on a page , the Render Phase (That is the code inside the doView Method) is executed for every Page refresh ??

Please let me know if i am correct ??
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: Liferay : Understanding the execution of Action Phase and Render Phase

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
yes.