public interface MVCActionCommand extends MVCCommand
MVCPortlet
.
The action command to be invoked is determined by two factors:
ActionRequest.ACTION_NAME
of the action URL.
Implementations of this interface must be OSGi components that are registered in the OSGi Registry with the following properties:
javax.portlet.name
: The portlet name associated to this action
command.
mvc.command.name
: the command name to match with the parameter
value ActionRequest.ACTION_NAME
. This name cannot contain any
comma (,
).
The method MVCPortlet.processAction(ActionRequest, ActionResponse)
searches the OSGi Registry for the action command that matches both the
portlet name with the property javax.portlet.name
and the
parameter value ActionRequest.ACTION_NAME
with the property
mvc.command.name
.
In general, only one action command is executed per portlet action URL. If
the parameter value ActionRequest.ACTION_NAME
is, however, a
comma separated list of names, MVCPortlet
finds the matching action
commands and invokes them sequentially in the order they're specified in the
list.
When there are multiple action commands registered for the same portlet name and with the same command name, only the action command with the highest service ranking is invoked.
BaseMVCActionCommand
is an abstract class that implements this
interface and can be extended to simplify using action commands.
Modifier and Type | Field and Description |
---|---|
static MVCActionCommand |
EMPTY |
Modifier and Type | Method and Description |
---|---|
boolean |
processAction(ActionRequest actionRequest,
ActionResponse actionResponse)
Invoked by
MVCPortlet to allow the portlet to process an action
request. |
static final MVCActionCommand EMPTY
boolean processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException
MVCPortlet
to allow the portlet to process an action
request.actionRequest
- the action requestactionResponse
- the action responsetrue
if an error occurs in processing the action
request; false
otherwisePortletException