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.rest
Class RestActionInvocation

    java.lang.Object
      com.opensymphony.xwork2.DefaultActionInvocation
          org.apache.struts2.rest.RestActionInvocation

All Implemented Interfaces:
  com.opensymphony.xwork2.ActionInvocation, Serializable

    public class RestActionInvocation

extends com.opensymphony.xwork2.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 Object` | `target`

Fields inherited from class com.opensymphony.xwork2.DefaultActionInvocation
`action, actionEventListener, container, executed, explicitResult, extraContext, interceptors, invocationContext, objectFactory, ognlUtil, preResultListeners, proxy, pushAction, result, resultCode, stack, unknownHandlerManager, valueStackFactory`

Constructor Summary
`protected` | `RestActionInvocation(Map<String,Object> extraContext, boolean pushAction)`

Method Summary
`String` | `invoke()`
`protected void` | `processResult()`
`protected String` | `saveResult(com.opensymphony.xwork2.config.entities.ActionConfig actionConfig, Object methodResult)` Save the result to be used later.
`protected void` | `selectTarget()`
`void` | `setDefaultErrorResultName(String value)`
`void` | `setLogger(String value)`
`void` | `setMimeTypeHandlerSelector(ContentTypeHandlerManager sel)`
`void` | `setRestrictToGet(String value)` 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.

Methods inherited from class com.opensymphony.xwork2.DefaultActionInvocation
`addPreResultListener, createAction, createContextMap, createInterceptors, createResult, deserialize, getAction, getInvocationContext, getProxy, getResult, getResultCode, getStack, init, invokeAction, invokeActionOnly, isExecuted, serialize, setActionEventListener, setContainer, setObjectFactory, setOgnlUtil, 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 Object target

### isFirstInterceptor

    protected boolean isFirstInterceptor

### hasErrors

    protected boolean hasErrors

Constructor Detail

### RestActionInvocation

    protected RestActionInvocation(Map<String,Object> extraContext,
                                   boolean pushAction)

Method Detail

### setLogger

    public void setLogger(String value)

### setDefaultErrorResultName

    public void setDefaultErrorResultName(String value)

### setRestrictToGet

    public void setRestrictToGet(String value)

  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

  Parameters:
    `value` - true or false

### setMimeTypeHandlerSelector

    public void setMimeTypeHandlerSelector(ContentTypeHandlerManager sel)

### saveResult

    protected String saveResult(com.opensymphony.xwork2.config.entities.ActionConfig actionConfig,
                                Object methodResult)

  Save the result to be used later.

  Overrides:
    `saveResult` in class `com.opensymphony.xwork2.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

    public String invoke()
                  throws Exception

  Specified by:
    `invoke` in interface `com.opensymphony.xwork2.ActionInvocation`
  Overrides:
    `invoke` in class `com.opensymphony.xwork2.DefaultActionInvocation`
  Throws:
    `Exception`

### processResult

    protected void processResult()
                          throws Exception

  Throws:
    `Exception`

### updateStatusFromResult

    protected void updateStatusFromResult()

  Get the status code from HttpHeaderResult and it is saved in the HttpHeaders object.

### selectTarget

    protected void selectTarget()

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–2018 Apache Software Foundation. All rights reserved.