Interface ResponseAdapter

All Known Implementing Classes:
AbstractResponseAdapter

public interface ResponseAdapter
  • Method Summary

    Modifier and Type
    Method
    Description
    Provides a `PrintWriter` for writing content to the response.
    void
    Sets the character encoding for the response.
    void
    setContentType(String contentType)
    Sets the content type of the response.
    void
    setHeader(String name, String value)
    Sets a header on the response.
    void
    setStatus(int status)
    Sets the HTTP status code for the response.
  • Method Details

    • getWriter

      PrintWriter getWriter() throws Exception
      Provides a `PrintWriter` for writing content to the response.
      Returns:
      The `PrintWriter` for the response.
      Throws:
      Exception - if the writer cannot be retrieved.
    • setHeader

      void setHeader(String name, String value)
      Sets a header on the response.
      Parameters:
      name - The name of the header.
      value - The value of the header.
    • setContentType

      void setContentType(String contentType)
      Sets the content type of the response.
      Parameters:
      contentType - The MIME type of the response content.
    • setCharacterEncoding

      void setCharacterEncoding(String encoding)
      Sets the character encoding for the response.
      Parameters:
      encoding - The character encoding to use.
    • setStatus

      void setStatus(int status)
      Sets the HTTP status code for the response.
      Parameters:
      status - The HTTP status code.