Interface MVCActionCommand

All Superinterfaces:
MVCCommand
All Known Subinterfaces:
FormMVCActionCommand
All Known Implementing Classes:
BaseFormMVCActionCommand, BaseMVCActionCommand, BaseTransactionalMVCActionCommand

public interface MVCActionCommand extends MVCCommand
Provides an interface to allow the portlet to process a particular action request. This interface can only be used when the portlet is based on MVCPortlet.

The action command to be invoked is determined by two factors:

  • The portlet name that the action URL refers to.
  • The parameter value 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.

Author:
Michael C. Han
  • Field Details

  • Method Details

    • processAction

      boolean processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException
      Invoked by MVCPortlet to allow the portlet to process an action request.
      Parameters:
      actionRequest - the action request
      actionResponse - the action response
      Returns:
      true if an error occurs in processing the action request; false otherwise
      Throws:
      PortletException