O'Reilly logo

JavaServer Pages, Second Edition by Hans Bergsten

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 support by JSP 1.2, 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required