HttpServletResponse (Class)

Represents the response of a servlet returned to a client.

There is only one instance of this class accessible by the response variable.

Methods

setContentType

Changes the document type of the response.

sendRedirect

Returns a temporary redirection to another URL.

addCookie

Adds a cookie to the response.

addHeader

Adds an additional HTTP header to the response.

sendError

Returns an error response using the error code passed as a parameter.

Features

Available in:

  • JSSP
  • WebApp