Name

response

Synopsis

The response variable is assigned a reference to an internal container-dependent class that implements a protocol-dependent interface that extends the javax.servlet.ServletResponse. Since HTTP is the only protocol supported by JSP 2.0, the class always implements the javax.servlet.http.HttpServletResponse interface. The method descriptions in this section include all methods from both interfaces.

Synopsis

Variable name:

response

EL expression

${pageContext.response}

Interface name:

javax.servlet.http.HttpServletResponse

Extends:

javax.servlet.ServletResponse

Implemented by:

Internal container-dependent class

JSP page type:

Available in both regular JSP pages and error pages

Methods

public void addCookie(Cookie cookie)

Adds the specified cookie to the response.

public void addDateHeader(String headername, long date)

Adds a response header with the given name and date value. The date is specified in terms of milliseconds since the epoch (January 1, 1970, 00:00:00 GMT).

public void addHeader(String headername, String value)

Adds a response header with the specified name and value.

public void addIntHeader(String headername, int value)

Adds a response header with the given name and integer value.

public boolean containsHeader(String name)

Returns a boolean indicating whether the named response header has already been set.

public String encodeRedirectURL(String url)

Encodes the specified URL for use in the sendRedirect( ) method by including the session ...

Get JavaServer Pages, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.