org.apache.struts2.portlet.dispatcher
Class DirectRenderFromEventAction

java.lang.Object
  extended by org.apache.struts2.portlet.dispatcher.DirectRenderFromEventAction
All Implemented Interfaces:
Action, Serializable, SessionAware, PortletActionConstants

public class DirectRenderFromEventAction
extends Object
implements SessionAware, PortletActionConstants, Action, Serializable

When a portlet is targetted for an event, the portlet will receive two portlet requests, one for the event phase, and then followed by a render operation. When in the event phase, the action that is executed can't render any output. This means that if an action in the XWork configuration is executed in the event phase, and the action is set up with a result that should render something, the result can't immediately be executed. The portlet needs to "wait" to the render phase to do the rendering.

When the PortletResult detects such a scenario, instead of executing the actual view, it prepares a couple of render parameters specifying this action and the location of the view, which then will be executed in the following render request.

See Also:
Serialized Form

Field Summary
private  String location
           
private static long serialVersionUID
           
 
Fields inherited from interface org.apache.struts2.portlet.PortletActionConstants
ACTION_PARAM, ACTION_RESET, DEFAULT_ACTION_FOR_MODE, DEFAULT_ACTION_NAME, DEFAULT_DISPATCHER_SERVLET_NAME, ERROR_ACTION, EVENT_ACTION, EVENT_PHASE, MODE_NAMESPACE_MAP, MODE_PARAM, PHASE, PORTLET_CONFIG, PORTLET_NAMESPACE, RENDER_DIRECT_LOCATION, RENDER_PHASE, REQUEST, RESPONSE, STACK_FROM_EVENT_PHASE
 
Fields inherited from interface com.opensymphony.xwork2.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
DirectRenderFromEventAction()
           
 
Method Summary
 String execute()
          Always return success.
 String getLocation()
          Get the location of the view.
 void setSession(Map session)
          Sets the Map of session attributes in the implementing class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

location

private String location
Constructor Detail

DirectRenderFromEventAction

public DirectRenderFromEventAction()
Method Detail

getLocation

public String getLocation()
Get the location of the view.

Returns:
Returns the location.

execute

public String execute()
               throws Exception
Always return success.

Specified by:
execute in interface Action
Returns:
SUCCESS
Throws:
Exception - thrown if a system level exception occurs. Application level exceptions should be handled by returning an error value, such as Action.ERROR.

setSession

public void setSession(Map session)
Description copied from interface: SessionAware
Sets the Map of session attributes in the implementing class.

Specified by:
setSession in interface SessionAware
Parameters:
session - a Map of HTTP session attribute name/value pairs.


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