GenericPortlet class has two init methods
1.public void init(PortletConfig config) throws PortletException { .. }
2. public void init() throws PortletException { }
The first method is called by Portlet Container and it also calls init() method.
So in our subclass it always recommended to override inti() method (i.e method with no arguments)
Code snippet from GenericPortlet.java
/**
*
* A convenience method which can be overridden so that there's no need to
* call <code>super.init(config)</code>.
*
* <p>
* Instead of overriding {@link #init(PortletConfig)}, simply override this
* method and it will be called by
* <code>GenericPortlet.init(PortletConfig config)</code>. The
* <code>PortletConfig</code> object can still be retrieved via {@link
* #getPortletConfig}.
*
* @exception PortletException
* if an exception has occurred that interferes with the
* portlet normal operation.
* @exception UnavailableException
* if the portlet is unavailable to perform init
*/
public void init() throws PortletException {
}
No comments:
Post a Comment