org.apache.struts2.rest

## Class RestActionSupport

- java.lang.Object
- - org.apache.struts2.ActionSupport
  - - com.opensymphony.xwork2.ActionSupport
    - - org.apache.struts2.rest.RestActionSupport

- All Implemented Interfaces:
    LocaleProvider, TextProvider, Serializable, Action, ValidationAware, Validateable

      public class RestActionSupport
      extends ActionSupport

  Extends `ActionSupport` to provides a default implementation of the index method that can be invoked for unknown actions by the `UnknownHandler`.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.opensymphony.xwork2.interceptor.ValidationAware

      `ValidationAware.LegacyAdapter`

  - ### Field Summary

    - ### Fields inherited from class org.apache.struts2.ActionSupport

      `container`

    - ### Fields inherited from interface org.apache.struts2.action.Action

      `ERROR, INPUT, LOGIN, NONE, SUCCESS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RestActionSupport()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `HttpHeaders` | `createContinue()` By default, return continue.
    `Object` | `index()` Default execution.
    `HttpHeaders` | `options()` Inspect the implemented methods to know the allowed http methods.
    `HttpHeaders` | `updateContinue()` By default, return continue.

    - ### Methods inherited from class org.apache.struts2.ActionSupport

      `addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, execute, getActionErrors, getActionMessages, getContainer, getFieldErrors, getFormatted, getLocale, getLocaleProvider, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTextProvider, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, toLocale, validate`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.struts2.action.Action

      `execute`

    - ### Methods inherited from interface org.apache.struts2.Validateable

      `validate`

    - ### Methods inherited from interface com.opensymphony.xwork2.interceptor.ValidationAware

      `adapt`

    - ### Methods inherited from interface org.apache.struts2.interceptor.ValidationAware

      `addActionError, addActionMessage, addFieldError, getActionErrors, getActionMessages, getFieldErrors, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors`

- - ### Constructor Detail

    - #### RestActionSupport

          public RestActionSupport()

  - ### Method Detail

    - #### index

          public Object index()
                       throws Exception

      Default execution.
      Returns:
        object because it can return string, result or httpHeader.
      Throws:
        `Exception` - in case of any error

    - #### options

          public HttpHeaders options()

      Inspect the implemented methods to know the allowed http methods.
      Returns:
        Include the header "Allow" with the allowed http methods.

    - #### createContinue

          public HttpHeaders createContinue()

      By default, return continue. Is possible override the method to return expectation failed.
      Returns:
        continue

    - #### updateContinue

          public HttpHeaders updateContinue()

      By default, return continue. Is possible override the method to return expectation failed.
      Returns:
        continue

Copyright © 2000–2025 Apache Software Foundation. All rights reserved.