Every portlet class should extend javax.portlet.GenericPortlet. Every Portlet executes certain methods that constitutes the lifecycle of a portlet.
Every portlet, (similar to Servlets)
1. gets intialilzed through init() method.
2. serves the requests through renderRequest() and processAction() methods
3. reliquishes the resources and ends its life through the destroy() method.
Whenever an action event is triggered in the portlet, the processAction() method is called.
This processAction() performs any task that should be executed for that event and passes the control to renderRequest() method. Only one portlet action is triggered each time.
The renderRequest() method is responsible for producing the markup that is based on the state and mode of the portlet.
The portlet sets the MIME type on the response and generates the markup either by directly writing to the output stream or by including a servlet or JSP that generates the markup.
Let us consider a portal that has three portlets, A,B and C. An action event can be triggered in any one of the three portlets. Let us say ‘A’ triggers an event.
The whole portal page is rendered.
Here is what happens.
1.processAction() of portlet A is invoked and executed.
2.Once processAction() of portlet A is completed, render process starts.The renderRequest() methods of each portlet is called.
3.The final portal page is rendered to the user.
Next: Simple portlet folder structure in RAD

