Class GenericPortlet
- java.lang.Object
-
- jakarta.portlet.GenericPortlet
-
- All Implemented Interfaces:
EventPortlet,HeaderPortlet,Portlet,PortletConfig,ResourceServingPortlet
public abstract class GenericPortlet extends Object implements Portlet, PortletConfig, EventPortlet, ResourceServingPortlet, HeaderPortlet
TheGenericPortletclass provides a default implementation for thePortletinterface.It provides an abstract class to be subclassed to create portlets. A subclass of
GenericPortletshould either use one of the following annotations:@ProcessAction@ProcessEvent@RenderMode
- processAction, to handle action requests
- doView, to handle render requests when in VIEW mode
- doEdit, to handle render requests when in EDIT mode
- doHelp, to handle render request when in HELP mode
- init and destroy, to manage resources that are held for the life of the servlet
Normally there is no need to override the render or the doDispatch methods. Render handles render requests setting the title of the portlet in the response and invoking doDispatch. doDispatch dispatches the request to one of the doView, doEdit or doHelp method depending on the portlet mode indicated in the request.
Portlets typically run on multithreaded servers, so please note that a portlet must handle concurrent requests and be careful to synchronize access to shared resources. Shared resources include in-memory data such as instance or class variables and external objects such as files, database connections, and network connections.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTOMATIC_RESOURCE_DISPATCHThis property is set by the container if the container has a cached response for the given validation tag.
-
Constructor Summary
Constructors Constructor Description GenericPortlet()Does nothing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Called by the portlet container to indicate to a portlet that the portlet is being taken out of service.protected booleandispatchAnnotatedActionMethod(String name, ActionRequest request, ActionResponse response)Dispatches an action request to an annotated action method.protected booleandispatchAnnotatedEventMethod(String name, EventRequest request, EventResponse response)Dispatches an event request to an annotated event method.protected booleandispatchAnnotatedRenderMethod(String name, RenderRequest request, RenderResponse response)Dispatches an render request to an annotated render method.protected voiddoDispatch(RenderRequest request, RenderResponse response)The default implementation of this method routes the render request to: method annotated with@RenderModeand the name of the portlet mode a set of helper methods depending on the current portlet mode the portlet is currently in.protected voiddoEdit(RenderRequest request, RenderResponse response)Helper method to serve up theeditmode.protected voiddoHeaders(RenderRequest request, RenderResponse response)Used by the render method to set the response properties and headers.protected voiddoHelp(RenderRequest request, RenderResponse response)Helper method to serve up thehelpmode.protected voiddoView(RenderRequest request, RenderResponse response)Helper method to serve up the mandatoryviewmode.Map<String,String[]>getContainerRuntimeOptions()Returns the container runtime options and values for this portlet.StringgetDefaultNamespace()Returns the default namespace for events and public parameters.StringgetInitParameter(String name)Returns a String containing the value of the named initialization * parameter, or null if the parameter does not exist.Enumeration<String>getInitParameterNames()Returns the names of the portlet initialization parameters as an Enumeration of String objects, or an empty Enumeration if the portlet has no initialization parameters.protected Collection<PortletMode>getNextPossiblePortletModes(RenderRequest request)Used by the render method to set the next possible portlet modes.PortletConfiggetPortletConfig()Returns the PortletConfig object of this portlet.PortletContextgetPortletContext()Returns thePortletContextof the portlet application the portlet is in.Enumeration<PortletMode>getPortletModes(String mimeType)Returns anEnumerationof PortletMode objects that are defined for the portlet for the given MIME type.StringgetPortletName()Returns the name of this portlet.Enumeration<QName>getProcessingEventQNames()Returns the QNames of the processing events supported by the portlet as anEnumerationofQNameobjects, or an emptyEnumerationif the portlet has not defined any processing events.Map<String,QName>getPublicRenderParameterDefinitions()Returns a Map of public render parameter names to their qualified names.Enumeration<String>getPublicRenderParameterNames()Returns the names of the public render parameters supported by the portlet as anEnumerationof String objects, or an emptyEnumerationif the portlet has no public render parameters.Enumeration<QName>getPublishingEventQNames()Returns the QNames of the publishing events supported by the portlet as anEnumerationofQNameobjects, or an emptyEnumerationif the portlet has not defined any publishing events.ResourceBundlegetResourceBundle(Locale locale)Gets the resource bundle for the given locale based on the resource bundle defined in the deployment descriptor withresource-bundletag or the inlined resources defined in the deployment descriptor.Enumeration<Locale>getSupportedLocales()Returns the locales supported by the portlet as anEnumerationofLocaleobjects, or an emptyEnumerationif the portlet has not defined any supported locales.protected StringgetTitle(RenderRequest request)Used by the render method to get the title.Enumeration<WindowState>getWindowStates(String mimeType)Returns anEnumerationof WindowState objects that are defined for the portlet for the given MIME type.voidinit()A convenience method which can be overridden so that there's no need to callsuper.init(config).voidinit(PortletConfig config)Called by the portlet container to indicate to a portlet that the portlet is being placed into service.voidprocessAction(ActionRequest request, ActionResponse response)Called by the portlet container to allow the portlet to process an action request.voidprocessEvent(EventRequest request, EventResponse response)The default implementation tries to dispatch to a method annotated with@ProcessEventthat matches the event name or, if no such method is found just sets the current render parameters on the response.
Note that the annotated methods needs to be public in order to be allowed to be called byGenericPortlet.voidrender(RenderRequest request, RenderResponse response)The default implementation of this method sets the headers using thedoHeadersmethod, sets the title using thegetTitlemethod and invokes thedoDispatchmethod.voidrenderHeaders(HeaderRequest request, HeaderResponse response)V3 method implementing the headers stage within the render phase.voidserveResource(ResourceRequest request, ResourceResponse response)Default resource serving.
-
-
-
Field Detail
-
AUTOMATIC_RESOURCE_DISPATCH
public static final String AUTOMATIC_RESOURCE_DISPATCH
This property is set by the container if the container has a cached response for the given validation tag. The property can be retrieved using thegetPropertymethod.The value is
"jakarta.portlet.automaticResourceDispatching".- Since:
- 3.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(PortletConfig config) throws PortletException
Called by the portlet container to indicate to a portlet that the portlet is being placed into service.The default implementation stores the
PortletConfigobject and checks for annotated methods with the annotations- @ProcessAction
- @ProcessEvent
- @RenderMode
The portlet container calls the
initmethod exactly once after instantiating the portlet. Theinitmethod must complete successfully before the portlet can receive any requests.The portlet container cannot place the portlet into service if the
initmethod does one of the following:- it throws a
PortletException - it does not return within a time period defined by the Web server
- Specified by:
initin interfacePortlet- Parameters:
config- aPortletConfigobject containing the portlet configuration and initialization parameters- Throws:
PortletException- if an exception has occurred that interferes with the portlet normal operation.UnavailableException- if the portlet cannot perform the initialization at this time.
-
init
public void init() throws PortletExceptionA convenience method which can be overridden so that there's no need to callsuper.init(config).Instead of overriding
init(PortletConfig), simply override this method and it will be called byGenericPortlet.init(PortletConfig config). ThePortletConfigobject can still be retrieved viagetPortletConfig().- Throws:
PortletException- if an exception has occurred that interferes with the portlet normal operation.UnavailableException- if the portlet is unavailable to perform init
-
processAction
public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
Called by the portlet container to allow the portlet to process an action request. This method is called if the client request was originated by a URL created (by the portlet) with theRenderResponse.createActionURL()method.The default implementation tries to dispatch to a method annotated with
@ProcessActionthat matches the action parameter valueActionRequest.ACTION_NAMEor, if no such method is found throws aPortletException.
Note that the annotated methods needs to be public in order to be allowed to be called byGenericPortlet.- Specified by:
processActionin interfacePortlet- Parameters:
request- the action requestresponse- the action response- Throws:
PortletException- if the portlet cannot fulfill the requestUnavailableException- if the portlet is unavailable to process the action at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem
-
renderHeaders
public void renderHeaders(HeaderRequest request, HeaderResponse response) throws PortletException, IOException
V3 method implementing the headers stage within the render phase. The default implementation does nothing.Version 3 portlets should override this method to set HTTP headers, cookies, and to provide markup for the overall document
HEADsection.- Specified by:
renderHeadersin interfaceHeaderPortlet- Parameters:
request- the header requestresponse- the header response- Throws:
PortletException- if the portlet has problems fulfilling the requestUnavailableException- if the portlet is unavailable to process the request at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem
-
render
public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException
The default implementation of this method sets the headers using thedoHeadersmethod, sets the title using thegetTitlemethod and invokes thedoDispatchmethod.It also evaluates the
RENDER_PARTrequest attribute and if set calls thedoHeaders, getNextPossiblePortletModesandgetTitlemethods for theRENDER_HEADERSpart and thedoDispatchmethod for theRENDER_MARKUPpart.
If theRENDER_PARTrequest attribute is not set all of the above methods will be called.- Specified by:
renderin interfacePortlet- Parameters:
request- the render requestresponse- the render response- Throws:
PortletException- if the portlet cannot fulfill the requestUnavailableException- if the portlet is unavailable to perform render at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem
-
getTitle
protected String getTitle(RenderRequest request)
Used by the render method to get the title.The default implementation gets the title from the ResourceBundle of the PortletConfig of the portlet. The title is retrieved using the 'jakarta.portlet.title' resource name.
Portlets can overwrite this method to provide dynamic titles (e.g. based on locale, client, and session information). Examples are:
- language-dependent titles for multi-lingual portals
- shorter titles for WAP phones
- the number of messages in a mailbox portlet
- Parameters:
request- the render request- Returns:
- the portlet title for this window
- Throws:
IllegalStateException- if no portlet config object is available
-
doDispatch
protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException
The default implementation of this method routes the render request to:-
method annotated with
@RenderModeand the name of the portlet mode -
a set of helper methods depending on the current portlet mode the portlet
is currently in. These methods are:
doViewfor handlingviewrequestsdoEditfor handlingeditrequestsdoHelpfor handlinghelprequests
If the window state of this portlet is
minimized, this method does not invoke any of the portlet mode rendering methods.For handling custom portlet modes the portlet should either use the
@RenderModeannotation or override this method. Note that the annotated methods needs to be public in order to be allowed to be called byGenericPortlet.- Parameters:
request- the render requestresponse- the render response- Throws:
PortletException- if the portlet cannot fulfill the requestUnavailableException- if the portlet is unavailable to perform render at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem- See Also:
doView(RenderRequest, RenderResponse),doEdit(RenderRequest, RenderResponse),doHelp(RenderRequest, RenderResponse)
-
method annotated with
-
doView
protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
Helper method to serve up the mandatoryviewmode.The default implementation throws an exception.
- Parameters:
request- the portlet requestresponse- the render response- Throws:
PortletException- if the portlet cannot fulfill the requestUnavailableException- if the portlet is unavailable to perform render at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem
-
doEdit
protected void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException
Helper method to serve up theeditmode.The default implementation throws an exception.
- Parameters:
request- the portlet requestresponse- the render response- Throws:
PortletException- if the portlet cannot fulfill the requestUnavailableException- if the portlet is unavailable to perform render at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem
-
doHelp
protected void doHelp(RenderRequest request, RenderResponse response) throws PortletException, IOException
Helper method to serve up thehelpmode.The default implementation throws an exception.
- Parameters:
request- the portlet requestresponse- the render response- Throws:
PortletException- if the portlet cannot fulfill the requestUnavailableException- if the portlet is unavailable to perform render at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem
-
getPortletConfig
public PortletConfig getPortletConfig()
Returns the PortletConfig object of this portlet.- Returns:
- the PortletConfig object of this portlet
-
destroy
public void destroy()
Called by the portlet container to indicate to a portlet that the portlet is being taken out of service.The default implementation does nothing.
-
getPortletName
public String getPortletName()
Returns the name of this portlet.- Specified by:
getPortletNamein interfacePortletConfig- Returns:
- the portlet name
- See Also:
PortletConfig.getPortletName()
-
getPortletContext
public PortletContext getPortletContext()
Returns thePortletContextof the portlet application the portlet is in.- Specified by:
getPortletContextin interfacePortletConfig- Returns:
- the portlet application context
- See Also:
PortletContext
-
getResourceBundle
public ResourceBundle getResourceBundle(Locale locale)
Gets the resource bundle for the given locale based on the resource bundle defined in the deployment descriptor withresource-bundletag or the inlined resources defined in the deployment descriptor.- Specified by:
getResourceBundlein interfacePortletConfig- Parameters:
locale- the locale for which to retrieve the resource bundle- Returns:
- the resource bundle for the given locale
-
getInitParameter
public String getInitParameter(String name)
Returns a String containing the value of the named initialization * parameter, or null if the parameter does not exist.- Specified by:
getInitParameterin interfacePortletConfig- Parameters:
name- aStringspecifying the name of the initialization parameter- Returns:
- a
Stringcontaining the value of the initialization parameter - Throws:
IllegalArgumentException- if name isnull.
-
getInitParameterNames
public Enumeration<String> getInitParameterNames()
Returns the names of the portlet initialization parameters as an Enumeration of String objects, or an empty Enumeration if the portlet has no initialization parameters.- Specified by:
getInitParameterNamesin interfacePortletConfig- Returns:
- an
EnumerationofStringobjects containing the names of the portlet initialization parameters, or an empty Enumeration if the portlet has no initialization parameters.
-
getProcessingEventQNames
public Enumeration<QName> getProcessingEventQNames()
Description copied from interface:PortletConfigReturns the QNames of the processing events supported by the portlet as anEnumerationofQNameobjects, or an emptyEnumerationif the portlet has not defined any processing events.Processing events are defined in the portlet deployment descriptor with the
supported-processing-eventelement.If the event was defined using the
nameelement instead of theqnameelement the defined default namespace is added as namespace for the returned QName.- Specified by:
getProcessingEventQNamesin interfacePortletConfig- Returns:
- an
EnumerationofQNameobjects containing the names of the processing events, or an emptyEnumerationif the portlet has not defined any support for processing events in the deployment descriptor.
-
getPublishingEventQNames
public Enumeration<QName> getPublishingEventQNames()
Description copied from interface:PortletConfigReturns the QNames of the publishing events supported by the portlet as anEnumerationofQNameobjects, or an emptyEnumerationif the portlet has not defined any publishing events.Publishing events are defined in the portlet deployment descriptor with the
supported-publishing-eventelement.Note that this call does not return any events published that have not been declared in the deployment descriptor as supported.
If the event was defined using the
nameelement instead of theqnameelement the defined default namespace is added as namespace for the returned QName.- Specified by:
getPublishingEventQNamesin interfacePortletConfig- Returns:
- an
EnumerationofQNameobjects containing the names of the publishing events, or an emptyEnumerationif the portlet has not defined any support for publishing events in the deployment descriptor.
-
getSupportedLocales
public Enumeration<Locale> getSupportedLocales()
Description copied from interface:PortletConfigReturns the locales supported by the portlet as anEnumerationofLocaleobjects, or an emptyEnumerationif the portlet has not defined any supported locales.Supported locales are defined in the portlet deployment descriptor with the
supported-localeelement.- Specified by:
getSupportedLocalesin interfacePortletConfig- Returns:
- an
EnumerationofLocaleobjects containing the supported locales, or an emptyEnumerationif the portlet has not defined any supported locales in the deployment descriptor.
-
getContainerRuntimeOptions
public Map<String,String[]> getContainerRuntimeOptions()
Description copied from interface:PortletConfigReturns the container runtime options and values for this portlet.The portlet can set container runtime options in the
portlet.xmlvia thecontainer-runtime-optionelement with a name and a value on the application and portlet level.
If a container runtime option is set on the portlet application level and on the portlet level with the same name the setting on the portlet level takes precedence and overwrites the one set on the portal application level.The map returned from this method will provide the subset the portlet container supports of the options the portlet has specified in the
portlet.xml. Options that the portlet container does not support will not be returned in this map.The map will contain name of the runtime option as key of type String and the runtime options as values of type String array (
String[]) with the values specified in theportlet.xmldeployment descriptor.- Specified by:
getContainerRuntimeOptionsin interfacePortletConfig- Returns:
- an immutable
Mapcontaining portlet container runtime options names as keys and the container runtime values as map values, or an emptyMapif no portlet container runtime options are set in theportlet.xmlor supported by this portlet container. The keys in the map are of type String. The values in the map are of type String array (String[]).
-
serveResource
public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException
Default resource serving.The default implementation of this method does nothing.
However, if the reserved portlet initialization parameter
AUTOMATIC_RESOURCE_DISPATCH(= "jakarta.portlet.automaticResourceDispatching") is set totrue, the default implementation will perform aPortletRequestDispatcher.forwardto the location designated by the ResourceID of the ResourceRequest. If no ResourceID is set on the resource URL the default implementation does nothing.- Specified by:
serveResourcein interfaceResourceServingPortlet- Parameters:
request- the resource requestresponse- the resource response- Throws:
PortletException- if the portlet has problems fulfilling the rendering requestUnavailableException- if the portlet is unavailable to perform render at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem- Since:
- 2.0
-
processEvent
public void processEvent(EventRequest request, EventResponse response) throws PortletException, IOException
The default implementation tries to dispatch to a method annotated with@ProcessEventthat matches the event name or, if no such method is found just sets the current render parameters on the response.
Note that the annotated methods needs to be public in order to be allowed to be called byGenericPortlet.- Specified by:
processEventin interfaceEventPortlet- Parameters:
request- the event requestresponse- the event response- Throws:
PortletException- if the portlet has problems fulfilling the requestUnavailableException- if the portlet is unavailable to process the event at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem- Since:
- 2.0
- See Also:
EventPortlet.processEvent(jakarta.portlet.EventRequest, jakarta.portlet.EventResponse)
-
doHeaders
protected void doHeaders(RenderRequest request, RenderResponse response) throws PortletException, IOException
Used by the render method to set the response properties and headers.The portlet should override this method and set its response header using this method in order to ensure that they are set before anything is written to the output stream.
The default implemention of this method is emtpy.
- Parameters:
request- the render requestresponse- the render response- Throws:
PortletException- if the portlet cannot fulfill the requestUnavailableException- if the portlet is unavailable to perform render at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem- Since:
- 2.0
-
getNextPossiblePortletModes
protected Collection<PortletMode> getNextPossiblePortletModes(RenderRequest request)
Used by the render method to set the next possible portlet modes.The portlet should override this method and set the next possible portlet modes using this method in order to ensure that they are set before anything is written to the output stream.
The default implemention of this method returns
null.- Parameters:
request- the render request- Returns:
- the next possible portlet modes
- Since:
- 2.0
-
getPublicRenderParameterNames
public Enumeration<String> getPublicRenderParameterNames()
Returns the names of the public render parameters supported by the portlet as anEnumerationof String objects, or an emptyEnumerationif the portlet has no public render parameters.- Specified by:
getPublicRenderParameterNamesin interfacePortletConfig- Returns:
- an
EnumerationofStringobjects containing the names of the public render parameters, or an emptyEnumerationif the portlet does not define any public render parameters. - See Also:
PortletConfig.getPublicRenderParameterNames()
-
getDefaultNamespace
public String getDefaultNamespace()
Returns the default namespace for events and public parameters. This namespace is defined in the portlet deployment descriptor with thedefault-namespaceelement.If no default namespace is defined in the portlet deployment descriptor this methods returns the XML default namespace
XMLConstants.NULL_NS_URI.- Specified by:
getDefaultNamespacein interfacePortletConfig- Returns:
- the default namespace defined in the portlet deployment
descriptor, or
XMLConstants.NULL_NS_URIis non is defined. - See Also:
PortletConfig.getDefaultNamespace()
-
getPortletModes
public Enumeration<PortletMode> getPortletModes(String mimeType)
Returns anEnumerationof PortletMode objects that are defined for the portlet for the given MIME type.Note that a supported portlet mode may not be allowed in all situations due to security or other reasons. To determine whether a portlet mode is allowed during a request, use the
PortletRequest.isPortletModeAllowed(PortletMode)method. To determine which portlet modes are supported by the portal, usePortalContext.getSupportedPortletModes()- Specified by:
getPortletModesin interfacePortletConfig- Parameters:
mimeType- MIME type- Returns:
- an
EnumerationofPortletModeobjects containing the defined and supported portlet modes. - Since:
- 3.0
- See Also:
PortletMode,PortletRequest.isPortletModeAllowed(PortletMode)
-
getWindowStates
public Enumeration<WindowState> getWindowStates(String mimeType)
Returns anEnumerationof WindowState objects that are defined for the portlet for the given MIME type.Note that a supported window state may not be allowed in all situations due to security or other reasons. To determine whether a window state is allowed during a request, use the
PortletRequest.isWindowStateAllowed(WindowState)method. To determine which window states are supported by the portal, usePortalContext.getSupportedWindowStates().- Specified by:
getWindowStatesin interfacePortletConfig- Parameters:
mimeType- MIME type- Returns:
- an
EnumerationofWindowStateobjects containing the defined and supported window states. - Since:
- 3.0
- See Also:
WindowState,PortletRequest.isWindowStateAllowed(WindowState)
-
getPublicRenderParameterDefinitions
public Map<String,QName> getPublicRenderParameterDefinitions()
Returns a Map of public render parameter names to their qualified names. The names are the values returned by thePortletConfig.getPublicRenderParameterNames()method. The values are theQNamevalues associated with the public render parameter.If the public render parameter is specified in the portlet descriptor using the
<name>tag rather than the<qname>tag, the QName is built from the default namespace from the deployment descriptor together with the value from the<name>tag.- Specified by:
getPublicRenderParameterDefinitionsin interfacePortletConfig- Returns:
- an
MapofStringtoQName - Since:
- 3.0
- See Also:
PortletConfig.getPublicRenderParameterNames()
-
dispatchAnnotatedActionMethod
protected boolean dispatchAnnotatedActionMethod(String name, ActionRequest request, ActionResponse response) throws PortletException, IOException
Dispatches an action request to an annotated action method.Retrieves an action method annotated with the provided name and invokes it. Returns
trueif the method could be successfully located and invoked, andfalseif no annotated action method by that name could be found.This method allows a portlet to extend annotation processing for the action method.
- Parameters:
name- Annotation namerequest- Action requestresponse- Action response- Returns:
true, if the request was dispatched,false, if no annotated method matching the specified action method name could be found.- Throws:
PortletException- if the portlet cannot fulfill the requestUnavailableException- if the portlet is unavailable to process the action at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem- Since:
- 3.0
- See Also:
processAction(ActionRequest, ActionResponse)
-
dispatchAnnotatedEventMethod
protected boolean dispatchAnnotatedEventMethod(String name, EventRequest request, EventResponse response) throws PortletException, IOException
Dispatches an event request to an annotated event method.Retrieves an action method annotated with the provided name and invokes it. Returns
trueif the method could be successfully located and invoked, andfalseif no annotated event method by that name could be found.This method allows a portlet to extend annotation processing for portlet events.
- Parameters:
name- Annotation namerequest- Event requestresponse- Event response- Returns:
true, if the request was dispatched,false, if no annotated method matching the specified event method name could be found.- Throws:
PortletException- if the portlet cannot fulfill the requestUnavailableException- if the portlet is unavailable to process the action at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem- Since:
- 3.0
- See Also:
processEvent(EventRequest, EventResponse)
-
dispatchAnnotatedRenderMethod
protected boolean dispatchAnnotatedRenderMethod(String name, RenderRequest request, RenderResponse response) throws PortletException, IOException
Dispatches an render request to an annotated render method.Retrieves an render method annotated with the provided name and invokes it. Returns
trueif the method could be successfully located and invoked, andfalseif no annotated render method by that name could be found.This method allows a portlet to extend annotation processing for the render methods.
- Parameters:
name- Annotation namerequest- Render requestresponse- Render response- Returns:
true, if the request was dispatched,false, if no annotated method matching the specified render method name could be found.- Throws:
PortletException- if the portlet cannot fulfill the requestUnavailableException- if the portlet is unavailable to process the render at this timePortletSecurityException- if the portlet cannot fulfill this request due to security reasonsIOException- if the streaming causes an I/O problem- Since:
- 3.0
- See Also:
doDispatch(RenderRequest, RenderResponse)
-
-