Variable name:


Interface name:




Implemented by:

Internal container-dependent class

JSP page type:

Available in both regular JSP pages and error pages


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


public Object getAttribute(String name)

Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

public java.util.Enumeration getAttributeNames()

Returns an Enumeration containing the names of the attributes available to this request. The Enumeration is empty if the request doesn’t have any attributes.

public String getAuthType()

Returns the name of the authentication scheme used to protect the servlet (for example, BASIC or SSL), or null if the servlet is not protected.

public String getCharacterEncoding()

Returns the name of the character encoding method used in the body of this request, or null if the request does not specify a character encoding method.

public int getContentLength()

Returns the length, in bytes, of the request body (if it is made available by the input ...

Get JavaServer Pages Pocket Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.