Interface RequestHeaders

All Known Implementing Classes:
HttpRequestHeaders

@PublicApi public interface RequestHeaders
This is a subset of the HttpServletResponse that just deals with setting headers.
See Also:
  • HttpServletResponse
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addDateHeader(String name, long date)
    Adds a response header with the given name and date-value.
    void
    addHeader(String name, String value)
    Adds a response header with the given name and value.
    void
    addIntHeader(String name, int value)
    Adds a response header with the given name and integer value.
    void
    setDateHeader(String name, long date)
    Sets a response header with the given name and date-value.
    void
    setHeader(String name, String value)
    Sets a response header with the given name and value.
    void
    setIntHeader(String name, int value)
    Sets a response header with the given name and integer value.
  • Method Details

    • setDateHeader

      void setDateHeader(String name, long date)
      Sets a response header with the given name and date-value. The date is specified in terms of milliseconds since the epoch. If the header had already been set, the new value overwrites the previous one.
      Parameters:
      name - the name of the header to set
      date - the assigned date value
      See Also:
    • addDateHeader

      void addDateHeader(String name, long date)
      Adds a response header with the given name and date-value. The date is specified in terms of milliseconds since the epoch. This method allows response headers to have multiple values.
      Parameters:
      name - the name of the header to set
      date - the additional date value
      See Also:
    • setHeader

      void setHeader(String name, String value)
      Sets a response header with the given name and value.

      If the header had already been set, the new value overwrites the previous one.

      Parameters:
      name - the name of the header
      value - the header value
      See Also:
    • addHeader

      void addHeader(String name, String value)
      Adds a response header with the given name and value.

      This method allows response headers to have multiple values.

      Parameters:
      name - the name of the header
      value - the additional header value
      See Also:
    • setIntHeader

      void setIntHeader(String name, int value)
      Sets a response header with the given name and integer value. If the header had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.
      Parameters:
      name - the name of the header
      value - the assigned integer value
      See Also:
    • addIntHeader

      void addIntHeader(String name, int value)
      Adds a response header with the given name and integer value. This method allows response headers to have multiple values.
      Parameters:
      name - the name of the header
      value - the assigned integer value
      See Also: