public class RestActionInvocation extends DefaultActionInvocation
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.Modifier and Type | Field and Description |
---|---|
protected boolean |
hasErrors |
protected HttpHeaders |
httpHeaders |
protected boolean |
isFirstInterceptor |
protected Object |
target |
action, actionEventListener, asyncAction, asyncManager, container, executed, explicitResult, extraContext, interceptors, invocationContext, lazyParamInjector, objectFactory, ognlUtil, preResultListeners, proxy, pushAction, result, resultCode, stack, unknownHandlerManager, valueStackFactory
Modifier | Constructor and Description |
---|---|
protected |
RestActionInvocation(Map<String,Object> extraContext,
boolean pushAction) |
Modifier and Type | Method and Description |
---|---|
String |
invoke() |
protected void |
processResult() |
protected String |
saveResult(ActionConfig actionConfig,
Object methodResult)
Save the result to be used later.
|
protected void |
selectTarget() |
void |
setDefaultErrorResultName(String defaultErrorResultName) |
void |
setLogger(String logger) |
void |
setMimeTypeHandlerSelector(ContentTypeHandlerManager selector) |
void |
setRestrictToGet(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 method
|
protected void |
updateStatusFromResult()
Get the status code from HttpHeaderResult and it is saved in the HttpHeaders object.
|
addPreResultListener, createAction, createContextMap, createInterceptors, createResult, getAction, getInvocationContext, getProxy, getResult, getResultCode, getStack, init, invokeAction, invokeActionOnly, isExecuted, prepareLazyParamInjector, setActionEventListener, setAsyncManager, setContainer, setObjectFactory, setOgnlUtil, setResultCode, setUnknownHandlerManager, setValueStackFactory
protected HttpHeaders httpHeaders
protected Object target
protected boolean isFirstInterceptor
protected boolean hasErrors
public void setLogger(String logger)
public void setDefaultErrorResultName(String defaultErrorResultName)
public void setRestrictToGet(String restrictToGet)
restrictToGet
- true or falsepublic void setMimeTypeHandlerSelector(ContentTypeHandlerManager selector)
protected String saveResult(ActionConfig actionConfig, Object methodResult)
saveResult
in class DefaultActionInvocation
actionConfig
- current ActionConfigmethodResult
- the result of the action.ConfigurationException
- If it is an incorrect result.public String invoke() throws Exception
invoke
in interface ActionInvocation
invoke
in class DefaultActionInvocation
Exception
protected void updateStatusFromResult()
protected void selectTarget()
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.