Save This Page
Home » apache-tomcat-6.0.26-src » org.apache » catalina » connector » [javadoc | source]
org.apache.catalina.connector
public class: Request [javadoc | source]
java.lang.Object
   org.apache.catalina.connector.Request

All Implemented Interfaces:
    HttpServletRequest

Wrapper object for the Coyote request.
Field Summary
protected  Request coyoteRequest    Coyote request. 
protected static final  TimeZone GMT_ZONE     
protected static  StringManager sm    The string manager for this package. 
protected  Cookie[] cookies    The set of cookies associated with this Request. 
protected  SimpleDateFormat[] formats    The set of SimpleDateFormat formats to use in getDateHeader(). Notice that because SimpleDateFormat is not thread-safe, we can't declare formats[] as a static variable. 
protected static  Locale defaultLocale    The default Locale if none are specified. 
protected  HashMap attributes    The attributes associated with this Request, keyed by attribute name. 
protected  ArrayList locales    The preferred Locales assocaited with this Request. 
protected  String authType    Authentication type. 
protected  CometEventImpl event    Associated event. 
protected  boolean comet    Comet state 
protected  Object dispatcherType    The current dispatcher type. 
protected  InputBuffer inputBuffer    The associated input buffer. 
protected  CoyoteInputStream inputStream    ServletInputStream. 
protected  CoyoteReader reader    Reader. 
protected  boolean usingInputStream    Using stream flag. 
protected  boolean usingReader    Using writer flag. 
protected  Principal userPrincipal    User principal. 
protected  boolean sessionParsed    Session parsed flag. 
protected  boolean parametersParsed    Request parameters parsed flag. 
protected  boolean cookiesParsed    Cookies parsed flag. 
protected  boolean secure    Secure flag. 
protected transient  Subject subject    The Subject associated with the current AccessControllerContext 
protected static  int CACHED_POST_LEN    Post data buffer. 
protected  byte[] postData     
protected  ParameterMap parameterMap    Hash map used in the getParametersMap method. 
protected  Session session    The currently active session for this request. 
protected  Object requestDispatcherPath    The current request dispatcher path. 
protected  boolean requestedSessionCookie    Was the requested session ID received in a cookie? 
protected  String requestedSessionId    The requested session ID (if any) for this request. 
protected  boolean requestedSessionURL    Was the requested session ID received in a URL? 
protected  boolean localesParsed    Parse locales. 
protected  int localPort    Local port 
protected  String remoteAddr    Remote address. 
protected  String remoteHost    Remote host. 
protected  int remotePort    Remote port 
protected  String localAddr    Local address 
protected  String localName    Local address 
protected  Connector connector    Associated Catalina connector. 
protected  Context context    Associated context. 
protected  FilterChain filterChain    Filter chain associated with the request. 
protected static final  String info    Descriptive information about this Request implementation. 
protected  MappingData mappingData    Mapping data. 
protected  RequestFacade facade    The facade associated with this request. 
protected  Response response    The response with which this request is associated. 
protected  B2CConverter URIConverter    URI byte to char converter (not recycled). 
protected  Wrapper wrapper    Associated wrapper. 
Constructor:
 public Request() 
Method from org.apache.catalina.connector.Request Summary:
addCookie,   addHeader,   addLocale,   addParameter,   changeSessionId,   clearCookies,   clearEncoders,   clearHeaders,   clearLocales,   clearParameters,   cometClose,   configureSessionCookie,   createInputStream,   doGetSession,   finishRequest,   getAttribute,   getAttributeNames,   getAuthType,   getAvailable,   getCharacterEncoding,   getConnector,   getContentLength,   getContentType,   getContext,   getContextPath,   getContextPathMB,   getCookies,   getCoyoteRequest,   getDateHeader,   getDecodedRequestURI,   getDecodedRequestURIMB,   getEvent,   getFilterChain,   getHeader,   getHeaderNames,   getHeaders,   getHost,   getInfo,   getInputStream,   getIntHeader,   getLocalAddr,   getLocalName,   getLocalPort,   getLocale,   getLocales,   getMappingData,   getMethod,   getNote,   getNoteNames,   getParameter,   getParameterMap,   getParameterNames,   getParameterValues,   getPathInfo,   getPathInfoMB,   getPathTranslated,   getPrincipal,   getProtocol,   getQueryString,   getReader,   getRealPath,   getRemoteAddr,   getRemoteHost,   getRemotePort,   getRemoteUser,   getRequest,   getRequestDispatcher,   getRequestPathMB,   getRequestURI,   getRequestURL,   getRequestedSessionId,   getResponse,   getScheme,   getServerName,   getServerPort,   getServletPath,   getServletPathMB,   getSession,   getSession,   getSessionInternal,   getSessionInternal,   getStream,   getURIConverter,   getUserPrincipal,   getWrapper,   isAlpha,   isComet,   isParametersParsed,   isRequestedSessionIdFromCookie,   isRequestedSessionIdFromURL,   isRequestedSessionIdFromUrl,   isRequestedSessionIdValid,   isSSLAttribute,   isSecure,   isUserInRole,   parseCookies,   parseLocales,   parseLocalesHeader,   parseParameters,   read,   readChunkedPostBody,   readPostBody,   recycle,   removeAttribute,   removeNote,   setAttribute,   setAuthType,   setCharacterEncoding,   setComet,   setCometTimeout,   setConnector,   setContentLength,   setContentType,   setContext,   setContextPath,   setCookies,   setCoyoteRequest,   setDecodedRequestURI,   setFilterChain,   setHost,   setMethod,   setNote,   setPathInfo,   setProtocol,   setQueryString,   setRemoteAddr,   setRemoteHost,   setRequestURI,   setRequestedSessionCookie,   setRequestedSessionId,   setRequestedSessionURL,   setResponse,   setScheme,   setSecure,   setServerName,   setServerPort,   setServletPath,   setStream,   setURIConverter,   setUserPrincipal,   setWrapper,   unescape
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.connector.Request Detail:
 public  void addCookie(Cookie cookie) 
    Add a Cookie to the set of Cookies associated with this Request.
 public  void addHeader(String name,
    String value) 
    Add a Header to the set of Headers associated with this Request.
 public  void addLocale(Locale locale) 
    Add a Locale to the set of preferred Locales for this Request. The first added Locale will be the first one returned by getLocales().
 public  void addParameter(String name,
    String[] values) 
    Add a parameter name and corresponding set of values to this Request. (This is used when restoring the original request on a form based login).
 public  void changeSessionId(String newSessionId) 
    Change the ID of the session that this request is associated with. There are several things that may trigger an ID change. These include moving between nodes in a cluster and session fixation prevention during the authentication process.
 public  void clearCookies() 
    Clear the collection of Cookies associated with this Request.
 public  void clearEncoders() 
    Clear cached encoders (to save memory for Comet requests).
 public  void clearHeaders() 
    Clear the collection of Headers associated with this Request.
 public  void clearLocales() 
    Clear the collection of Locales associated with this Request.
 public  void clearParameters() 
    Clear the collection of parameters associated with this Request.
 public  void cometClose() 
 protected  void configureSessionCookie(Cookie cookie) 
    Configures the given JSESSIONID cookie.
 public ServletInputStream createInputStream() throws IOException 
    Create and return a ServletInputStream to read the content associated with this Request.
 protected Session doGetSession(boolean create) 
 public  void finishRequest() throws IOException 
    Perform whatever actions are required to flush and close the input stream or reader, in a single operation.
 public Object getAttribute(String name) 
    Return the specified request attribute if it exists; otherwise, return null.
 public Enumeration getAttributeNames() 
 public String getAuthType() 
    Return the authentication type used for this Request.
 public boolean getAvailable() 
    Return true if bytes are available.
 public String getCharacterEncoding() 
    Return the character encoding for this Request.
 public Connector getConnector() 
    Return the Connector through which this Request was received.
 public int getContentLength() 
    Return the content length for this Request.
 public String getContentType() 
    Return the content type for this Request.
 public Context getContext() 
    Return the Context within which this Request is being processed.
 public String getContextPath() 
    Return the portion of the request URI used to select the Context of the Request.
 public MessageBytes getContextPathMB() 
    Get the context path.
 public Cookie[] getCookies() 
    Return the set of Cookies received with this Request.
 public Request getCoyoteRequest() 
    Get the Coyote request.
 public long getDateHeader(String name) 
    Return the value of the specified date header, if any; otherwise return -1.
 public String getDecodedRequestURI() 
    Get the decoded request URI.
 public MessageBytes getDecodedRequestURIMB() 
    Get the decoded request URI.
 public CometEventImpl getEvent() 
    Get the event associated with the request.
 public FilterChain getFilterChain() 
    Get filter chain associated with the request.
 public String getHeader(String name) 
    Return the first value of the specified header, if any; otherwise, return null
 public Enumeration getHeaderNames() 
    Return the names of all headers received with this request.
 public Enumeration getHeaders(String name) 
    Return all of the values of the specified header, if any; otherwise, return an empty enumeration.
 public Host getHost() 
    Return the Host within which this Request is being processed.
 public String getInfo() 
    Return descriptive information about this Request implementation and the corresponding version number, in the format <description>/<version>.
 public ServletInputStream getInputStream() throws IOException 
    Return the servlet input stream for this Request. The default implementation returns a servlet input stream created by createInputStream().
 public int getIntHeader(String name) 
    Return the value of the specified header as an integer, or -1 if there is no such header for this request.
 public String getLocalAddr() 
    Returns the Internet Protocol (IP) address of the interface on which the request was received.
 public String getLocalName() 
    Returns the host name of the Internet Protocol (IP) interface on which the request was received.
 public int getLocalPort() 
    Returns the Internet Protocol (IP) port number of the interface on which the request was received.
 public Locale getLocale() 
    Return the preferred Locale that the client will accept content in, based on the value for the first Accept-Language header that was encountered. If the request did not specify a preferred language, the server's default Locale is returned.
 public Enumeration getLocales() 
    Return the set of preferred Locales that the client will accept content in, based on the values for any Accept-Language headers that were encountered. If the request did not specify a preferred language, the server's default Locale is returned.
 public MappingData getMappingData() 
    Return mapping data.
 public String getMethod() 
    Return the HTTP request method used in this Request.
 public Object getNote(String name) 
    Return the object bound with the specified name to the internal notes for this request, or null if no such binding exists.
 public Iterator getNoteNames() 
    Return an Iterator containing the String names of all notes bindings that exist for this request.
 public String getParameter(String name) 
    Return the value of the specified request parameter, if any; otherwise, return null. If there is more than one value defined, return only the first one.
 public Map getParameterMap() 
    Returns a Map of the parameters of this request. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.
 public Enumeration getParameterNames() 
    Return the names of all defined request parameters for this request.
 public String[] getParameterValues(String name) 
    Return the defined values for the specified request parameter, if any; otherwise, return null.
 public String getPathInfo() 
    Return the path information associated with this Request.
 public MessageBytes getPathInfoMB() 
    Get the path info.
 public String getPathTranslated() 
    Return the extra path information for this request, translated to a real path.
 public Principal getPrincipal() 
    Return the principal that has been authenticated for this Request.
 public String getProtocol() 
    Return the protocol and version used to make this Request.
 public String getQueryString() 
    Return the query string associated with this request.
 public BufferedReader getReader() throws IOException 
    Read the Reader wrapping the input stream for this Request. The default implementation wraps a BufferedReader around the servlet input stream returned by createInputStream().
 public String getRealPath(String path) 
Deprecated! As - of version 2.1 of the Java Servlet API, use ServletContext.getRealPath().

    Return the real path of the specified virtual path.
 public String getRemoteAddr() 
    Return the remote IP address making this Request.
 public String getRemoteHost() 
    Return the remote host name making this Request.
 public int getRemotePort() 
    Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.
 public String getRemoteUser() 
    Return the name of the remote user that has been authenticated for this Request.
 public HttpServletRequest getRequest() 
    Return the ServletRequest for which this object is the facade. This method must be implemented by a subclass.
 public RequestDispatcher getRequestDispatcher(String path) 
    Return a RequestDispatcher that wraps the resource at the specified path, which may be interpreted as relative to the current request path.
 public MessageBytes getRequestPathMB() 
    Get the request path.
 public String getRequestURI() 
    Return the request URI for this request.
 public StringBuffer getRequestURL() 
    Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.

    Because this method returns a StringBuffer, not a String, you can modify the URL easily, for example, to append query parameters.

    This method is useful for creating redirect messages and for reporting errors.

 public String getRequestedSessionId() 
    Return the session identifier included in this request, if any.
 public Response getResponse() 
    Return the Response with which this Request is associated.
 public String getScheme() 
    Return the scheme used to make this Request.
 public String getServerName() 
    Return the server name responding to this Request.
 public int getServerPort() 
    Return the server port responding to this Request.
 public String getServletPath() 
    Return the portion of the request URI used to select the servlet that will process this request.
 public MessageBytes getServletPathMB() 
    Get the servlet path.
 public HttpSession getSession() 
    Return the session associated with this Request, creating one if necessary.
 public HttpSession getSession(boolean create) 
    Return the session associated with this Request, creating one if necessary and requested.
 public Session getSessionInternal() 
    Return the session associated with this Request, creating one if necessary.
 public Session getSessionInternal(boolean create) 
    Return the session associated with this Request, creating one if necessary and requested.
 public InputStream getStream() 
    Return the input stream associated with this Request.
 protected B2CConverter getURIConverter() 
    Return the URI converter.
 public Principal getUserPrincipal() 
    Return the principal that has been authenticated for this Request.
 public Wrapper getWrapper() 
    Return the Wrapper within which this Request is being processed.
 protected static final boolean isAlpha(String value) 
 public boolean isComet() 
    Return true if the current request is handling Comet traffic.
 public boolean isParametersParsed() 
    return true if we have parsed parameters
 public boolean isRequestedSessionIdFromCookie() 
    Return true if the session identifier included in this request came from a cookie.
 public boolean isRequestedSessionIdFromURL() 
    Return true if the session identifier included in this request came from the request URI.
 public boolean isRequestedSessionIdFromUrl() 
Deprecated! As - of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead.

    Return true if the session identifier included in this request came from the request URI.
 public boolean isRequestedSessionIdValid() 
    Return true if the session identifier included in this request identifies a valid session.
 static boolean isSSLAttribute(String name) 
    Test if a given name is one of the special Servlet-spec SSL attributes.
 public boolean isSecure() 
    Was this request received on a secure connection?
 public boolean isUserInRole(String role) 
    Return true if the authenticated user principal possesses the specified role name.
 protected  void parseCookies() 
    Parse cookies.
 protected  void parseLocales() 
    Parse request locales.
 protected  void parseLocalesHeader(String value) 
    Parse accept-language header value.
 protected  void parseParameters() 
    Parse request parameters.
 public boolean read() throws IOException 
    Clear cached encoders (to save memory for Comet requests).
 protected byte[] readChunkedPostBody() throws IOException 
    Read chunked post body.
 protected int readPostBody(byte[] body,
    int len) throws IOException 
    Read post body in an array.
 public  void recycle() 
    Release all object references, and initialize instance variables, in preparation for reuse of this object.
 public  void removeAttribute(String name) 
    Remove the specified request attribute if it exists.
 public  void removeNote(String name) 
    Remove any object bound to the specified name in the internal notes for this request.
 public  void setAttribute(String name,
    Object value) 
    Set the specified request attribute to the specified value.
 public  void setAuthType(String type) 
    Set the authentication type used for this request, if any; otherwise set the type to null. Typical values are "BASIC", "DIGEST", or "SSL".
 public  void setCharacterEncoding(String enc) throws UnsupportedEncodingException 
    Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader().
 public  void setComet(boolean comet) 
    Set comet state.
 public  void setCometTimeout(long timeout) 
 public  void setConnector(Connector connector) 
    Set the Connector through which this Request was received.
 public  void setContentLength(int length) 
    Set the content length associated with this Request.
 public  void setContentType(String type) 
    Set the content type (and optionally the character encoding) associated with this Request. For example, text/html; charset=ISO-8859-4.
 public  void setContext(Context context) 
    Set the Context within which this Request is being processed. This must be called as soon as the appropriate Context is identified, because it identifies the value to be returned by getContextPath(), and thus enables parsing of the request URI.
 public  void setContextPath(String path) 
    Set the context path for this Request. This will normally be called when the associated Context is mapping the Request to a particular Wrapper.
 public  void setCookies(Cookie[] cookies) 
    Set the set of cookies recieved with this Request.
 public  void setCoyoteRequest(Request coyoteRequest) 
    Set the Coyote request.
 public  void setDecodedRequestURI(String uri) 
    Set the decoded request URI.
 public  void setFilterChain(FilterChain filterChain) 
    Set filter chain associated with the request.
 public  void setHost(Host host) 
    Set the Host within which this Request is being processed. This must be called as soon as the appropriate Host is identified, and before the Request is passed to a context.
 public  void setMethod(String method) 
    Set the HTTP request method used for this Request.
 public  void setNote(String name,
    Object value) 
    Bind an object to a specified name in the internal notes associated with this request, replacing any existing binding for this name.
 public  void setPathInfo(String path) 
    Set the path information for this Request. This will normally be called when the associated Context is mapping the Request to a particular Wrapper.
 public  void setProtocol(String protocol) 
    Set the protocol name and version associated with this Request.
 public  void setQueryString(String query) 
    Set the query string for this Request. This will normally be called by the HTTP Connector, when it parses the request headers.
 public  void setRemoteAddr(String remoteAddr) 
    Set the IP address of the remote client associated with this Request.
 public  void setRemoteHost(String remoteHost) 
    Set the fully qualified name of the remote client associated with this Request.
 public  void setRequestURI(String uri) 
    Set the unparsed request URI for this Request. This will normally be called by the HTTP Connector, when it parses the request headers.
 public  void setRequestedSessionCookie(boolean flag) 
    Set a flag indicating whether or not the requested session ID for this request came in through a cookie. This is normally called by the HTTP Connector, when it parses the request headers.
 public  void setRequestedSessionId(String id) 
    Set the requested session ID for this request. This is normally called by the HTTP Connector, when it parses the request headers.
 public  void setRequestedSessionURL(boolean flag) 
    Set a flag indicating whether or not the requested session ID for this request came in through a URL. This is normally called by the HTTP Connector, when it parses the request headers.
 public  void setResponse(Response response) 
    Set the Response with which this Request is associated.
 public  void setScheme(String scheme) 
    Set the name of the scheme associated with this request. Typical values are http, https, and ftp.
 public  void setSecure(boolean secure) 
    Set the value to be returned by isSecure() for this Request.
 public  void setServerName(String name) 
    Set the name of the server (virtual host) to process this request.
 public  void setServerPort(int port) 
    Set the port number of the server to process this request.
 public  void setServletPath(String path) 
    Set the servlet path for this Request. This will normally be called when the associated Context is mapping the Request to a particular Wrapper.
 public  void setStream(InputStream stream) 
    Set the input stream associated with this Request.
 protected  void setURIConverter(B2CConverter URIConverter) 
    Set the URI converter.
 public  void setUserPrincipal(Principal principal) 
    Set the Principal who has been authenticated for this Request. This value is also used to calculate the value to be returned by the getRemoteUser() method.
 public  void setWrapper(Wrapper wrapper) 
    Set the Wrapper within which this Request is being processed. This must be called as soon as the appropriate Wrapper is identified, and before the Request is ultimately passed to an application servlet.
 protected String unescape(String s)