Package org.apache.struts2.rest
Class RestActionInvocation
java.lang.Object
org.apache.struts2.DefaultActionInvocation
org.apache.struts2.rest.RestActionInvocation
- All Implemented Interfaces:
- ActionInvocation
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.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleanprotected HttpHeadersprotected booleanprotected ObjectFields inherited from class org.apache.struts2.DefaultActionInvocationaction, actionEventListener, asyncAction, asyncManager, container, executed, explicitResult, extraContext, interceptors, invocationContext, lazyParamInjector, objectFactory, ognlUtil, preResultListeners, proxy, pushAction, result, resultCode, stack, unknownHandlerManager, valueStackFactory
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedRestActionInvocation(Map<String, Object> extraContext, boolean pushAction) 
- 
Method SummaryModifier and TypeMethodDescriptioninvoke()protected voidprotected StringsaveResult(ActionConfig actionConfig, Object methodResult) Save the result to be used later.protected voidvoidsetDefaultErrorResultName(String defaultErrorResultName) voidvoidvoidsetRestrictToGet(String restrictToGet) If set to true (by default) blocks returning content from any other methods than GET, if set to false, the content can be returned for any kind of methodprotected voidGet the status code from HttpHeaderResult and it is saved in the HttpHeaders object.Methods inherited from class org.apache.struts2.DefaultActionInvocationaddPreResultListener, createAction, createContextMap, createInterceptors, createResult, executeConditional, getAction, getInvocationContext, getProxy, getResult, getResultCode, getStack, init, invokeAction, invokeActionOnly, isExecuted, prepareLazyParamInjector, setActionEventListener, setAsyncManager, setContainer, setObjectFactory, setOgnlUtil, setResultCode, setUnknownHandlerManager, setValueStackFactory
- 
Field Details- 
httpHeaders
- 
target
- 
isFirstInterceptorprotected boolean isFirstInterceptor
- 
hasErrorsprotected boolean hasErrors
 
- 
- 
Constructor Details- 
RestActionInvocation
 
- 
- 
Method Details- 
setLogger
- 
setDefaultErrorResultName
- 
setRestrictToGetIf set to true (by default) blocks returning content from any other methods than GET, if set to false, the content can be returned for any kind of method- Parameters:
- restrictToGet- true or false
 
- 
setMimeTypeHandlerSelector
- 
saveResultSave the result to be used later.- Overrides:
- saveResultin class- DefaultActionInvocation
- Parameters:
- actionConfig- current ActionConfig
- methodResult- the result of the action.
- Returns:
- the result code to process.
- Throws:
- ConfigurationException- If it is an incorrect result.
 
- 
invoke- Specified by:
- invokein interface- ActionInvocation
- Overrides:
- invokein class- DefaultActionInvocation
- Throws:
- Exception
 
- 
processResult- Throws:
- Exception
 
- 
updateStatusFromResultprotected void updateStatusFromResult()Get the status code from HttpHeaderResult and it is saved in the HttpHeaders object.
- 
selectTargetprotected void selectTarget()
 
-