Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.portlet.context
Class PortletActionContext

    java.lang.Object
      org.apache.struts2.portlet.context.PortletActionContext

All Implemented Interfaces:
  PortletActionConstants

    public class PortletActionContext

extends Object
implements PortletActionConstants

PortletActionContext. ActionContext thread local for the portlet environment.

Version:
  $Revision: 495502 $ $Date: 2007-01-12 02:15:43 -0500 (Fri, 12 Jan 2007) $

Field Summary

Fields inherited from interface org.apache.struts2.portlet.PortletActionConstants
`ACTION_PARAM, DEFAULT_ACTION_FOR_MODE, DEFAULT_ACTION_NAME, ERROR_ACTION, EVENT_ACTION, EVENT_PHASE, MODE_NAMESPACE_MAP, MODE_PARAM, PHASE, PORTLET_CONFIG, PORTLET_NAMESPACE, RENDER_PHASE, REQUEST, RESPONSE`

Constructor Summary
`PortletActionContext()`

Method Summary
`static javax.portlet.ActionRequest` | `getActionRequest()` Get the ActionRequest.
`static javax.portlet.ActionResponse` | `getActionResponse()` Get the ActionRequest.
`private static ActionContext` | `getContext()`
`static ActionMapping` | `getDefaultActionForMode()` Get the default action mapping for the current mode.
`static Map` | `getModeNamespaceMap()` Get the namespace to mode mappings.
`static Integer` | `getPhase()` Get the phase that the portlet is executing in.
`static javax.portlet.PortletConfig` | `getPortletConfig()` Get the PortletConfig of the portlet that is executing.
`static String` | `getPortletNamespace()` Get the action namespace of the portlet.
`static javax.portlet.RenderRequest` | `getRenderRequest()` Get the RenderRequest.
`static javax.portlet.RenderResponse` | `getRenderResponse()` Get the RenderResponse.
`static javax.portlet.PortletRequest` | `getRequest()` Get the current PortletRequest.
`static javax.portlet.PortletResponse` | `getResponse()` Get the current PortletResponse
`static boolean` | `isEvent()`
`static boolean` | `isPortletRequest()` Check to see if the current request is a portlet request.
`static boolean` | `isRender()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PortletActionContext

    public PortletActionContext()

Method Detail

### getPortletConfig

    public static javax.portlet.PortletConfig getPortletConfig()

  Get the PortletConfig of the portlet that is executing.

  Returns:
    The PortletConfig of the executing portlet.

### getRenderRequest

    public static javax.portlet.RenderRequest getRenderRequest()

  Get the RenderRequest. Can only be invoked in the render phase.

  Returns:
    The current RenderRequest.
  Throws:
    `IllegalStateException` - If the method is invoked in the wrong phase.

### getRenderResponse

    public static javax.portlet.RenderResponse getRenderResponse()

  Get the RenderResponse. Can only be invoked in the render phase.

  Returns:
    The current RenderResponse.
  Throws:
    `IllegalStateException` - If the method is invoked in the wrong phase.

### getActionRequest

    public static javax.portlet.ActionRequest getActionRequest()

  Get the ActionRequest. Can only be invoked in the event phase.

  Returns:
    The current ActionRequest.
  Throws:
    `IllegalStateException` - If the method is invoked in the wrong phase.

### getActionResponse

    public static javax.portlet.ActionResponse getActionResponse()

  Get the ActionRequest. Can only be invoked in the event phase.

  Returns:
    The current ActionRequest.
  Throws:
    `IllegalStateException` - If the method is invoked in the wrong phase.

### getPortletNamespace

    public static String getPortletNamespace()

  Get the action namespace of the portlet. Used to organize actions for multiple portlets in the same portlet application.

  Returns:
    The portlet namespace as defined in `portlet.xml` and `struts.xml`

### getRequest

    public static javax.portlet.PortletRequest getRequest()

  Get the current PortletRequest.

  Returns:
    The current PortletRequest.

### getResponse

    public static javax.portlet.PortletResponse getResponse()

  Get the current PortletResponse

  Returns:
    The current PortletResponse.

### getPhase

    public static Integer getPhase()

  Get the phase that the portlet is executing in.

  Returns:
    `PortletActionConstants.RENDER_PHASE` in render phase, and `PortletActionConstants.EVENT_PHASE` in the event phase.

### isRender

    public static boolean isRender()

  Returns:
    `true` if the Portlet is executing in render phase.

### isEvent

    public static boolean isEvent()

  Returns:
    `true` if the Portlet is executing in the event phase.

### getContext

    private static ActionContext getContext()

  Returns:
    The current ActionContext.

### isPortletRequest

    public static boolean isPortletRequest()

  Check to see if the current request is a portlet request.

  Returns:
    `true` if the current request is a portlet request.

### getDefaultActionForMode

    public static ActionMapping getDefaultActionForMode()

  Get the default action mapping for the current mode.

  Returns:
    The default action mapping for the current portlet mode.

### getModeNamespaceMap

    public static Map getModeNamespaceMap()

  Get the namespace to mode mappings.

  Returns:
    The map of the namespaces for each mode.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.