org.apache.struts2.rest
Class RestActionInvocation

java.lang.Object
  extended by com.opensymphony.xwork2.DefaultActionInvocation
      extended by org.apache.struts2.rest.RestActionInvocation
All Implemented Interfaces:
ActionInvocation, java.io.Serializable

public class RestActionInvocation
extends DefaultActionInvocation

Extends the usual ActionInvocation to add support for processing the object returned from the action execution. This allows us to support methods that return HttpHeaders as well as apply content type-specific operations to the result.

See Also:
Serialized Form

Field Summary
protected  boolean hasErrors
           
protected  HttpHeaders httpHeaders
           
protected  boolean isFirstInterceptor
           
protected  java.lang.Object target
           
 
Fields inherited from class com.opensymphony.xwork2.DefaultActionInvocation
action, actionEventListener, container, executed, explicitResult, extraContext, interceptors, invocationContext, objectFactory, preResultListeners, proxy, pushAction, result, resultCode, stack, unknownHandlerManager, valueStackFactory
 
Constructor Summary
protected RestActionInvocation(java.util.Map extraContext, boolean pushAction)
           
 
Method Summary
 java.lang.String invoke()
           
protected  java.lang.String invokeAction(java.lang.Object action, ActionConfig actionConfig)
           
protected  void processResult()
           
protected  java.lang.String saveResult(ActionConfig actionConfig, java.lang.Object methodResult)
          Save the result to be used later.
protected  void selectTarget()
           
 void setDefaultErrorResultName(java.lang.String value)
           
 void setLogger(java.lang.String value)
           
 void setMimeTypeHandlerSelector(ContentTypeHandlerManager sel)
           
 
Methods inherited from class com.opensymphony.xwork2.DefaultActionInvocation
addPreResultListener, createAction, createContextMap, createResult, getAction, getInvocationContext, getProxy, getResult, getResultCode, getStack, init, invokeActionOnly, isExecuted, setActionEventListener, setConfiguration, setContainer, setObjectFactory, setResultCode, setUnknownHandlerManager, setValueStackFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httpHeaders

protected HttpHeaders httpHeaders

target

protected java.lang.Object target

isFirstInterceptor

protected boolean isFirstInterceptor

hasErrors

protected boolean hasErrors
Constructor Detail

RestActionInvocation

protected RestActionInvocation(java.util.Map extraContext,
                               boolean pushAction)
Method Detail

setLogger

public void setLogger(java.lang.String value)

setDefaultErrorResultName

public void setDefaultErrorResultName(java.lang.String value)

setMimeTypeHandlerSelector

public void setMimeTypeHandlerSelector(ContentTypeHandlerManager sel)

invokeAction

protected java.lang.String invokeAction(java.lang.Object action,
                                        ActionConfig actionConfig)
                                 throws java.lang.Exception
Overrides:
invokeAction in class DefaultActionInvocation
Throws:
java.lang.Exception

saveResult

protected java.lang.String saveResult(ActionConfig actionConfig,
                                      java.lang.Object methodResult)
Save the result to be used later.

Parameters:
actionConfig -
methodResult - the result of the action.
Returns:
the result code to process.
Throws:
ConfigurationException - If it is an incorrect result.

invoke

public java.lang.String invoke()
                        throws java.lang.Exception
Specified by:
invoke in interface ActionInvocation
Overrides:
invoke in class DefaultActionInvocation
Throws:
java.lang.Exception

processResult

protected void processResult()
                      throws java.lang.Exception
Throws:
java.lang.Exception

selectTarget

protected void selectTarget()


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