2 Minutes To Code (β Version)

Java Servlets - 2 minute tutorial

Introduction to HttpServletResponse

An instance of HttpServletResponse object is passed by the servlet container to the servlet and the servlet stuffs the http response that it wants to send to the client (headers, body, cookies etc) in this object.

When the servlet is done constructing the response, the container sends the response to the client in http protocol semantics.