public interface Portlet
Portlet interface is used by the portlet container to invoke the portlets. Every portlet has to
implement this interface, either by directly implementing it, or by using an existing class implementing the Portlet
interface.
A portlet is a Java technology-based web component. It is managed by the portlet container and processes requests and
generates dynamic content as response. Portlets are used by portals as pluggable user interface components.
The content generated by a portlet is called a fragment. A fragment is a piece of markup (e.g. HTML, XHTML, WML)
adhering to certain rules and can be aggregated with other fragments into a complete document. The content of a
portlet is normally aggregated with the content of other portlets into the portal page.
The portlet container instanciates portlets, manages their lifecycle and invoking them to process requests. The
lifecycle consists of: init method destroy method processAction
method, to perform actions targeted to the portlet render
method, to perform the render operation | Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Called by the portlet container to indicate to a portlet that the portlet is being taken out of service.
|
void |
init(PortletConfig config)
Called by the portlet container to indicate to a portlet that the portlet is being placed into service.
|
void |
processAction(ActionRequest request,
ActionResponse response)
Called by the portlet container to allow the portlet to process an action request.
|
void |
render(RenderRequest request,
RenderResponse response)
Called by the portlet container to allow the portlet to generate the content of the response based on its current
state.
|
void init(PortletConfig config) throws PortletException
The portlet container calls the init method exactly once after instantiating the portlet. The
init method must complete successfully before the portlet can receive any requests.
The portlet container cannot place the portlet into service if the init method
PortletException config - a PortletConfig object containing the portlet's configuration and initialization
parametersPortletException - if an exception has occurred that interferes with the portlet's normal operation.UnavailableException - if the portlet cannot perform the initialization at this time.void processAction(ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException
RenderResponse.createActionURL()
method.
Typically, in response to an action request, a portlet updates state based on the information sent in the action
request parameters. In an action the portlet may: request - the action requestresponse - the action responsePortletException - if the portlet has problems fulfilling the requestUnavailableException - if the portlet is unavailable to process the action at this timePortletSecurityException - if the portlet cannot fullfill this request because of security reasonsIOException - if the streaming causes an I/O problemvoid render(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
request - the render requestresponse - the render responsePortletException - if the portlet has problems fulfilling the rendering requestUnavailableException - if the portlet is unavailable to perform render at this timePortletSecurityException - if the portlet cannot fullfill this request because of security reasonsIOException - if the streaming causes an I/O problemvoid destroy()
This method enables the portlet to do the following:
Copyright © 2003-2019 GateIn. All Rights Reserved.