Package org.apache.struts2.rest

# Interface ContentTypeHandlerManager

All Known Implementing Classes:
  `DefaultContentTypeHandlerManager`

public interface ContentTypeHandlerManager
Manages content type handlers

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `STRUTS_REST_HANDLER_OVERRIDE_PREFIX`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `findExtension(String url)`
  Finds the extension in the url
  `ContentTypeHandler`
  `getHandlerForRequest(jakarta.servlet.http.HttpServletRequest req)`
  Gets the handler for the request by looking at the request content type and extension
  `ContentTypeHandler`
  `getHandlerForResponse(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)`
  Gets the handler for the response by looking at the extension of the request
  `String`
  `handleResult(ActionInvocation actionInvocation, Object methodResult, Object target)`
  Handles the result using handlers to generate content type-specific content

- ## Field Details

  - ### STRUTS_REST_HANDLER_OVERRIDE_PREFIX

    static final String STRUTS_REST_HANDLER_OVERRIDE_PREFIX
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getHandlerForRequest

    ContentTypeHandler getHandlerForRequest(jakarta.servlet.http.HttpServletRequest req)
    Gets the handler for the request by looking at the request content type and extension
    Parameters:
      `req` - The request
    Returns:
      The appropriate handler

  - ### getHandlerForResponse

    ContentTypeHandler getHandlerForResponse(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)
    Gets the handler for the response by looking at the extension of the request
    Parameters:
      `req` - The request
      `res` - The servlet response
    Returns:
      The appropriate handler

  - ### handleResult

    String handleResult(ActionInvocation actionInvocation, Object methodResult, Object target) throws IOException
    Handles the result using handlers to generate content type-specific content
    Parameters:
      `actionInvocation` - The action invocation for the current request
      `methodResult` - The object returned from the action method
      `target` - The object to return, usually the action object
    Returns:
      The new result code to process
    Throws:
      `IOException` - If unable to write to the response

  - ### findExtension

    String findExtension(String url)
    Finds the extension in the url
    Parameters:
      `url` - The url
    Returns:
      The extension