Skip to content

JSR 168 Notes

Portlet lifecycle
==========================
init,
render,
processAction and destroy.

In init, resource access , startup.

If exception in creation portlet then destroy method is not called and PorletException is thrown.

Class:
============================
Porlet: processAction, render request, action request

An action request = 1 action request and many render request, one portlet
A render request = many render request,

If -> caching is enabled for the portlets the render request may or may not be invoked.

processAction takes ActionRequest, ActionResponse
ActionRequest: parameters ,window state,  portlet mode, portal context, portlet session, porlet preferences data.

render takes RenderRequest, RenderResponse
porlet can delegate the generation of contents to – jsp or servlet.
============================
GenericPortlet – render method calls doDispatch
which in turn calls following methods:
-doView
-doEdit
-doHelp
-getTitle
depending on the state of the portlet.

If minimized state – then none of above methods called.
==========================

Different threads for same portlet.
So need to be able to handle concurrent execution of processAction and render methods.

=========================

PorletException,
PortletSecurityExceoption
UnavailableException

=========================

Portlet Config – gives access to, PorletContext and resource bundles.
– getInitParameters.

Porlet Resource Bundle.

(A) Portlet information : defined inline in the deployment descriptor. Portlet container must create a ResourceBundle and populate it, with  the inline values:

<portlet>
 …
  <portlet-info>
  <title>Stock Quote Portlet</title>
  <short-title>Stock</short-title>
  <keywords>finance,stock market</keywords>
 </portlet-info>
</portlet>
(B) If the resources are defined in a resource bundle, the portlet must  provide the name of the resource bundle.
Eg: <resource-bundle>com.foo.myApp.QuotePortlet</resource-bundle>

**** render method of GenericPortlet uses ResourceBundle of PortletConfig to get the portlet information.

====================================

PortletURL interface –

Portal creates objects of PortletURL using the class 
     
    RenderResponse

    — Its functions  createActionURL and createRenderURL are used. 

CRITICAL : Not use HTTP GET method:
Because some portal/portlet-containers implementations may encode internal state as part of the URL query string, portlet developers should not code forms using the HTTP GET method.

=========================

%d bloggers like this: