title: Understanding the execution of Action Phase and Render Phase
body: <p>I am using Liferay 6 for the Portal Development .</p>
  
  <p>By going through <a href="http://www.liferay.com/documentation/liferay-portal/6.0/development" rel="nofollow">Liferay Developer Guide</a> the author explains that there are  Two phases of Portlet Execution </p>
  
  <ol>
  <li>Action Phase </li>
  <li>Render Phase </li>
  </ol>
  
  <pre class="lang-java prettyprint-override"><code>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("&lt;BR/&gt;");
          PortletURL u = res.createActionURL();
          res.getWriter().println("&lt;A href=" + u + "&gt;Trigger an action.");
          res.getWriter().close();
      }
  
      public void processAction(ActionRequest req, ActionResponse res) throws PortletException 
      {
          req.setAttribute("datetime",new Date());
      }        
  }
  </code></pre>
  
  <p>My understanding is that the <code>doView</code> method is known as "<strong>Render Phase</strong>" and the <code>processAction</code> Method is known as "<strong>Action Phase</strong>".</p>
  
  <p>And if there are 5 portlets displayed on a page, the "Render Phase" (That is the code inside the <code>doView</code> Method) is executed for every Page refresh. </p>
  
  <p>Please let me know if i am correct.</p>