org.apache.struts2.portlet.result

## Class PortletResultHelperJSR286

- java.lang.Object
- - org.apache.struts2.portlet.result.PortletResultHelperJSR286

- All Implemented Interfaces:
    PortletResultHelper

      public class PortletResultHelperJSR286
      extends Object
      implements PortletResultHelper

  PortletResultHelperJSR286 implements PortletResultHelper for Portlet 2.0 API (JSR286).
  Author:
    Rene Gielen

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PortletResultHelperJSR286()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `include(javax.portlet.PortletRequestDispatcher dispatcher, String contentType, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response)` Call a dispatcher's include method, abstracted from the used Portlet API version.
    `void` | `setPortletMode(javax.portlet.PortletResponse response, javax.portlet.PortletMode portletMode)` Set a portlet mode, abstracted from the used Portlet API version.
    `void` | `setRenderParameter(javax.portlet.PortletResponse response, String key, String value)` Set a render parameter, abstracted from the used Portlet API version.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PortletResultHelperJSR286

          public PortletResultHelperJSR286()

  - ### Method Detail

    - #### setRenderParameter

          public void setRenderParameter(javax.portlet.PortletResponse response,
                                String key,
                                String value)

      Set a render parameter, abstracted from the used Portlet API version. This implementation assumes that the given response is a `StateAwareResponse`, as JSR286 implies.
      Specified by:
        `setRenderParameter` in interface `PortletResultHelper`
      Parameters:
        `response` - The response to set the parameter on.
        `key` - The parameter key to set.
        `value` - The parameter value to set.

    - #### setPortletMode

          public void setPortletMode(javax.portlet.PortletResponse response,
                            javax.portlet.PortletMode portletMode)
                              throws javax.portlet.PortletModeException

      Set a portlet mode, abstracted from the used Portlet API version. This implementation assumes that the given response is a `StateAwareResponse`, as JSR286 implies.
      Specified by:
        `setPortletMode` in interface `PortletResultHelper`
      Parameters:
        `response` - The response to set the portlet mode on.
        `portletMode` - The portlet mode to set.
      Throws:
        `javax.portlet.PortletModeException` - in case of errors during setting of portlet mode

    - #### include

          public void include(javax.portlet.PortletRequestDispatcher dispatcher,
                     String contentType,
                     javax.portlet.PortletRequest request,
                     javax.portlet.PortletResponse response)
                       throws IOException,
                              javax.portlet.PortletException

      Call a dispatcher's include method, abstracted from the used Portlet API version. This implementation assumes that the response is a `MimeResponse`, as JSR286 implies.
      Specified by:
        `include` in interface `PortletResultHelper`
      Parameters:
        `dispatcher` - The dispatcher to call the include method on.
        `contentType` - The content type to set for the response.
        `request` - The request to use for including
        `response` - The response to use for including
      Throws:
        `IOException` - in case of any I/O errors
        `javax.portlet.PortletException` - in case of any portlet errors

Copyright © 2000–2021 Apache Software Foundation. All rights reserved.