Name
ServletRequest
Synopsis
Interface Name: javax.servlet.ServletRequest
Superinterface: None
Immediate Subinterfaces:
javax.servlet.http.HttpServletRequest
Implemented By: None
Availability: Servlet API 1.0 and later
Description
A ServletRequest
object encapsulates information
about a single client request, including request parameters,
implementation-specific attributes, and an input stream for reading
binary data from the request body. ServletRequest
can be subclassed to provide additional protocol-specific
information. HttpServletRequest
, for instance,
includes methods to manipulate HTTP headers.
Interface Declaration
public interface ServletRequest { // Methods public abstract Object getAttribute(String name); public abstract String getCharacterEncoding(); // New in 2.0 public abstract int getContentLength(); public abstract String getContentType(); public abstract ServletInputStream getInputStream() throws IOException; public abstract String getParameter(String name); public abstract Enumeration getParameterNames(); public abstract String[] getParameterValues(String name); public abstract String getProtocol(); public abstract BufferedReader getReader() throws IOException;// New in 2.0 public abstract String getRealPath(String path); public abstract String getRemoteAddr(); public abstract String getRemoteHost(); public abstract String getScheme(); public abstract String getServerName(); public abstract int getServerPort(); }
Methods
getAttribute()
public abstract Object getAttribute(String ...
Get Java Servlet Programming 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.