Interface MVCHeaderCommand

All Superinterfaces:
MVCCommand

public interface MVCHeaderCommand extends MVCCommand
Provides an interface to handle the header phase of the portlet. This interface can only be used when the portlet is based on MVCPortlet.

The header command that to be invoked is determined by two factors:

  • The portlet name that the render URL is referring to.
  • The parameter value mvcRenderCommandName of the render URL.

Implementations of this interface must be OSGi components that are registered in the OSGi Registry with the following properties:

  • jakarta.portlet.name: The portlet name associated to this header command.
  • mvc.command.name: the command name that matches the parameter value mvcRenderCommandName. This name cannot contain any comma (,).

The method MVCPortlet.renderHeaders(HeaderRequest, HeaderResponse) searches the OSGi Registry for the header command that matches both the portlet name with the property jakarta.portlet.name and the parameter value mvc.command.name with the property mvc.command.name.

When there are multiple header commands registered for the same portlet name and with the same command name, only the header command with the highest service ranking is invoked.

Author:
Neil Griffin
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MVCHeaderCommand
     
  • Method Summary

    Modifier and Type
    Method
    Description
    renderHeaders(jakarta.portlet.HeaderRequest headerRequest, jakarta.portlet.HeaderResponse headerResponse)
    Invoked by MVCPortlet to handle the header phase of the portlet.
  • Field Details

  • Method Details

    • renderHeaders

      String renderHeaders(jakarta.portlet.HeaderRequest headerRequest, jakarta.portlet.HeaderResponse headerResponse) throws jakarta.portlet.PortletException
      Invoked by MVCPortlet to handle the header phase of the portlet.
      Parameters:
      headerRequest - the header request
      headerResponse - the header response
      Returns:
      the path that should be dispatched
      Throws:
      jakarta.portlet.PortletException