## org.apache.catalina.connector
Class HttpRequestBase

    java.lang.Object
      |
      +--org.apache.catalina.connector.RequestBase
            |
            +--org.apache.catalina.connector.HttpRequestBase

All Implemented Interfaces:
  HttpRequest, javax.servlet.http.HttpServletRequest, Request, javax.servlet.ServletRequest

Direct Known Subclasses:
  WarpRequest

public class HttpRequestBase
extends RequestBase
implements HttpRequest, javax.servlet.http.HttpServletRequest

Convenience base implementation of the HttpRequest interface, which can be used for the Request implementation required by most Connectors that implement the HTTP protocol. Only the connector-specific methods need to be implemented.

Version:
  $Revision: 1.31.2.4 $ $Date: 2002/04/09 13:29:37 $
Author:
  Craig R. McClanahan

Nested Class Summary
`protected class` `HttpRequestBase.PrivilegedGetSession`

Field Summary
`protected java.lang.String` `authType` The authentication type used for this request.
`protected java.lang.String` `contextPath` The context path for this request.
`protected java.util.ArrayList` `cookies` The set of cookies associated with this Request.
`protected static java.util.ArrayList` `empty` An empty collection to use for returning empty Enumerations.
`protected HttpRequestFacade` `facade` The facade associated with this request.
`protected java.text.SimpleDateFormat[]` `formats` The set of SimpleDateFormat formats to use in getDateHeader().
`protected java.util.HashMap` `headers` The HTTP headers associated with this Request, keyed by name.
`protected static java.lang.String` `info` Descriptive information about this HttpRequest implementation.
`protected java.lang.String` `method` The request method associated with this Request.
`protected ParameterMap` `parameters` The parsed parameters for this request.
`protected boolean` `parsed` Have the parameters for this request been parsed yet?
`protected java.lang.String` `pathInfo` The path information for this request.
`protected java.lang.String` `queryString` The query string for this request.
`protected boolean` `requestedSessionCookie` Was the requested session ID received in a cookie?
`protected java.lang.String` `requestedSessionId` The requested session ID (if any) for this request.
`protected boolean` `requestedSessionURL` Was the requested session ID received in a URL?
`protected java.lang.String` `requestURI` The request URI associated with this request.
`protected boolean` `secure` Was this request received on a secure channel?
`protected java.lang.String` `servletPath` The servlet path for this request.
`protected Session` `session` The currently active session for this request.
`protected java.security.Principal` `userPrincipal` The Principal who has been authenticated for this Request.

Fields inherited from class org.apache.catalina.connector.RequestBase
`attributes, authorization, characterEncoding, connector, contentLength, contentType, context, defaultLocale, input, locales, protocol, reader, remoteAddr, remoteHost, response, scheme, serverName, serverPort, sm, socket, stream, wrapper`

Fields inherited from interface javax.servlet.http.HttpServletRequest
`BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH`

Constructor Summary
`HttpRequestBase()`

Method Summary
`void` `addCookie(javax.servlet.http.Cookie cookie)` Add a Cookie to the set of Cookies associated with this Request.
`void` `addHeader(java.lang.String name, java.lang.String value)` Add a Header to the set of Headers associated with this Request.
`void` `addParameter(java.lang.String name, java.lang.String[] values)` Add a parameter name and corresponding set of values to this Request.
`void` `clearCookies()` Clear the collection of Cookies associated with this Request.
`void` `clearHeaders()` Clear the collection of Headers associated with this Request.
`void` `clearLocales()` Clear the collection of Locales associated with this Request.
`void` `clearParameters()` Clear the collection of parameters associated with this Request.
`java.lang.String` `getAuthType()` Return the authentication type used for this Request.
`java.lang.String` `getContextPath()` Return the portion of the request URI used to select the Context of the Request.
`javax.servlet.http.Cookie[]` `getCookies()` Return the set of Cookies received with this Request.
`long` `getDateHeader(java.lang.String name)` Return the value of the specified date header, if any; otherwise return -1.
`java.lang.String` `getHeader(java.lang.String name)` Return the first value of the specified header, if any; otherwise, return `null`
`java.util.Enumeration` `getHeaderNames()` Return the names of all headers received with this request.
`java.util.Enumeration` `getHeaders(java.lang.String name)` Return all of the values of the specified header, if any; otherwise, return an empty enumeration.
`java.lang.String` `getInfo()` Return descriptive information about this Request implementation and the corresponding version number, in the format `<description>/<version>`.
`int` `getIntHeader(java.lang.String name)` Return the value of the specified header as an integer, or -1 if there is no such header for this request.
`java.lang.String` `getMethod()` Return the HTTP request method used in this Request.
`java.lang.String` `getParameter(java.lang.String name)` Return the value of the specified request parameter, if any; otherwise, return `null`.
`java.util.Map` `getParameterMap()` Returns a `Map` of the parameters of this request.
`java.util.Enumeration` `getParameterNames()` Return the names of all defined request parameters for this request.
`java.lang.String[]` `getParameterValues(java.lang.String name)` Return the defined values for the specified request parameter, if any; otherwise, return `null`.
`java.lang.String` `getPathInfo()` Return the path information associated with this Request.
`java.lang.String` `getPathTranslated()` Return the extra path information for this request, translated to a real path.
`java.lang.String` `getQueryString()` Return the query string associated with this request.
`java.lang.String` `getRemoteUser()` Return the name of the remote user that has been authenticated for this Request.
`javax.servlet.ServletRequest` `getRequest()` Return the `ServletRequest` for which this object is the facade.
`javax.servlet.RequestDispatcher` `getRequestDispatcher(java.lang.String path)` Return a RequestDispatcher that wraps the resource at the specified path, which may be interpreted as relative to the current request path.
`java.lang.String` `getRequestedSessionId()` Return the session identifier included in this request, if any.
`java.lang.String` `getRequestURI()` Return the request URI for this request.
`java.lang.StringBuffer` `getRequestURL()` Reconstructs the URL the client used to make the request.
`java.lang.String` `getServletPath()` Return the portion of the request URI used to select the servlet that will process this request.
`javax.servlet.http.HttpSession` `getSession()` Return the session associated with this Request, creating one if necessary.
`javax.servlet.http.HttpSession` `getSession(boolean create)` Return the session associated with this Request, creating one if necessary and requested.
`java.security.Principal` `getUserPrincipal()` Return the principal that has been authenticated for this Request.
`boolean` `isRequestedSessionIdFromCookie()` Return `true` if the session identifier included in this request came from a cookie.
`boolean` `isRequestedSessionIdFromUrl()` Deprecated. As of Version 2.1 of the Java Servlet API, use `isRequestedSessionIdFromURL()` instead.
`boolean` `isRequestedSessionIdFromURL()` Return `true` if the session identifier included in this request came from the request URI.
`boolean` `isRequestedSessionIdValid()` Return `true` if the session identifier included in this request identifies a valid session.
`boolean` `isSecure()` Was this request received on a secure connection?
`boolean` `isUserInRole(java.lang.String role)` Return `true` if the authenticated user principal possesses the specified role name.
`protected void` `parseParameters()` Parse the parameters of this request, if it has not already occurred.
`void` `recycle()` Release all object references, and initialize instance variables, in preparation for reuse of this object.
`void` `setAuthType(java.lang.String authType)` Set the authentication type used for this request, if any; otherwise set the type to `null`.
`void` `setContextPath(java.lang.String path)` Set the context path for this Request.
`void` `setMethod(java.lang.String method)` Set the HTTP request method used for this Request.
`void` `setPathInfo(java.lang.String path)` Set the path information for this Request.
`void` `setQueryString(java.lang.String query)` Set the query string for this Request.
`void` `setRequestedSessionCookie(boolean flag)` Set a flag indicating whether or not the requested session ID for this request came in through a cookie.
`void` `setRequestedSessionId(java.lang.String id)` Set the requested session ID for this request.
`void` `setRequestedSessionURL(boolean flag)` Set a flag indicating whether or not the requested session ID for this request came in through a URL.
`void` `setRequestURI(java.lang.String uri)` Set the unparsed request URI for this Request.
`void` `setSecure(boolean secure)` Set the flag indicating whether this Request was received on a secure communications link or not.
`void` `setServletPath(java.lang.String path)` Set the servlet path for this Request.
`void` `setUserPrincipal(java.security.Principal principal)` Set the Principal who has been authenticated for this Request.

Methods inherited from class org.apache.catalina.connector.RequestBase

`addLocale, createInputStream, finishRequest, getAttribute, getAttributeNames, getAuthorization, getCharacterEncoding, getConnector, getContentLength, getContentType, getContext, getInputStream, getLocale, getLocales, getNote, getNoteNames, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getResponse, getScheme, getServerName, getServerPort, getSocket, getStream, getWrapper, removeAttribute, removeNote, setAttribute, setAuthorization, setCharacterEncoding, setConnector, setContentLength, setContentType, setContext, setNote, setProtocol, setRemoteAddr, setRemoteHost, setResponse, setScheme, setServerName, setServerPort, setSocket, setStream, setWrapper`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.apache.catalina.HttpRequest
`addLocale`

Methods inherited from interface org.apache.catalina.Request
`createInputStream, finishRequest, getAuthorization, getConnector, getContext, getNote, getNoteNames, getResponse, getSocket, getStream, getWrapper, removeNote, setAuthorization, setConnector, setContentLength, setContentType, setContext, setNote, setProtocol, setRemoteAddr, setResponse, setScheme, setServerName, setServerPort, setSocket, setStream, setWrapper`

Methods inherited from interface javax.servlet.ServletRequest
`getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getScheme, getServerName, getServerPort, removeAttribute, setAttribute, setCharacterEncoding`

Field Detail

### authType

    protected java.lang.String authType

  The authentication type used for this request.

### contextPath

    protected java.lang.String contextPath

  The context path for this request.

### cookies

    protected java.util.ArrayList cookies

  The set of cookies associated with this Request.

### empty

    protected static java.util.ArrayList empty

  An empty collection to use for returning empty Enumerations. Do not add any elements to this collection!

### formats

    protected java.text.SimpleDateFormat[] formats

  The set of SimpleDateFormat formats to use in getDateHeader().

### facade

    protected HttpRequestFacade facade

  The facade associated with this request.

### headers

    protected java.util.HashMap headers

  The HTTP headers associated with this Request, keyed by name. The values are ArrayLists of the corresponding header values.

### info

    protected static final java.lang.String info

  Descriptive information about this HttpRequest implementation.

  See Also:
    Constant Field Values

### method

    protected java.lang.String method

  The request method associated with this Request.

### parameters

    protected ParameterMap parameters

  The parsed parameters for this request. This is populated only if parameter information is requested via one of the `getParameter()` family of method calls. The key is the parameter name, while the value is a String array of values for this parameter.

  IMPLEMENTATION NOTE - Once the parameters for a particular request are parsed and stored here, they are not modified. Therefore, application level access to the parameters need not be synchronized.

### parsed

    protected boolean parsed

  Have the parameters for this request been parsed yet?

### pathInfo

    protected java.lang.String pathInfo

  The path information for this request.

### queryString

    protected java.lang.String queryString

  The query string for this request.

### requestedSessionCookie

    protected boolean requestedSessionCookie

  Was the requested session ID received in a cookie?

### requestedSessionId

    protected java.lang.String requestedSessionId

  The requested session ID (if any) for this request.

### requestedSessionURL

    protected boolean requestedSessionURL

  Was the requested session ID received in a URL?

### requestURI

    protected java.lang.String requestURI

  The request URI associated with this request.

### secure

    protected boolean secure

  Was this request received on a secure channel?

### servletPath

    protected java.lang.String servletPath

  The servlet path for this request.

### session

    protected Session session

  The currently active session for this request.

### userPrincipal

    protected java.security.Principal userPrincipal

  The Principal who has been authenticated for this Request.

Constructor Detail

### HttpRequestBase

    public HttpRequestBase()

Method Detail

### getInfo

    public java.lang.String getInfo()

  Return descriptive information about this Request implementation and the corresponding version number, in the format `<description>/<version>`.

  Specified by:
    `getInfo` in interface `Request`
  Overrides:
    `getInfo` in class `RequestBase`

### getRequest

    public javax.servlet.ServletRequest getRequest()

  Return the `ServletRequest` for which this object is the facade. This method must be implemented by a subclass.

  Specified by:
    `getRequest` in interface `Request`
  Overrides:
    `getRequest` in class `RequestBase`

### addCookie

    public void addCookie(javax.servlet.http.Cookie cookie)

  Add a Cookie to the set of Cookies associated with this Request.

  Specified by:
    `addCookie` in interface `HttpRequest`
  Parameters:
    `cookie` - The new cookie

### addHeader

    public void addHeader(java.lang.String name,
                          java.lang.String value)

  Add a Header to the set of Headers associated with this Request.

  Specified by:
    `addHeader` in interface `HttpRequest`
  Parameters:
    `name` - The new header name
    `value` - The new header value

### addParameter

    public void addParameter(java.lang.String name,
                             java.lang.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).

  Specified by:
    `addParameter` in interface `HttpRequest`
  Parameters:
    `name` - Name of this request parameter
    `values` - Corresponding values for this request parameter

### clearCookies

    public void clearCookies()

  Clear the collection of Cookies associated with this Request.

  Specified by:
    `clearCookies` in interface `HttpRequest`

### clearHeaders

    public void clearHeaders()

  Clear the collection of Headers associated with this Request.

  Specified by:
    `clearHeaders` in interface `HttpRequest`

### clearLocales

    public void clearLocales()

  Clear the collection of Locales associated with this Request.

  Specified by:
    `clearLocales` in interface `HttpRequest`

### clearParameters

    public void clearParameters()

  Clear the collection of parameters associated with this Request.

  Specified by:
    `clearParameters` in interface `HttpRequest`

### recycle

    public void recycle()

  Release all object references, and initialize instance variables, in preparation for reuse of this object.

  Specified by:
    `recycle` in interface `Request`
  Overrides:
    `recycle` in class `RequestBase`

### setAuthType

    public void setAuthType(java.lang.String authType)

  Set the authentication type used for this request, if any; otherwise set the type to `null`. Typical values are "BASIC", "DIGEST", or "SSL".

  Specified by:
    `setAuthType` in interface `HttpRequest`
  Parameters:
    `authType` - The authentication type used

### setContextPath

    public void setContextPath(java.lang.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.

  Specified by:
    `setContextPath` in interface `HttpRequest`
  Parameters:
    `path` - The context path

### setMethod

    public void setMethod(java.lang.String method)

  Set the HTTP request method used for this Request.

  Specified by:
    `setMethod` in interface `HttpRequest`
  Parameters:
    `method` - The request method

### setPathInfo

    public void setPathInfo(java.lang.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.

  Specified by:
    `setPathInfo` in interface `HttpRequest`
  Parameters:
    `path` - The path information

### setQueryString

    public void setQueryString(java.lang.String query)

  Set the query string for this Request. This will normally be called by the HTTP Connector, when it parses the request headers.

  Specified by:
    `setQueryString` in interface `HttpRequest`
  Parameters:
    `query` - The query string

### setRequestedSessionCookie

    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.

  Specified by:
    `setRequestedSessionCookie` in interface `HttpRequest`
  Parameters:
    `flag` - The new flag

### setRequestedSessionId

    public void setRequestedSessionId(java.lang.String id)

  Set the requested session ID for this request. This is normally called by the HTTP Connector, when it parses the request headers.

  Specified by:
    `setRequestedSessionId` in interface `HttpRequest`
  Parameters:
    `id` - The new session id

### setRequestedSessionURL

    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.

  Specified by:
    `setRequestedSessionURL` in interface `HttpRequest`
  Parameters:
    `flag` - The new flag

### setRequestURI

    public void setRequestURI(java.lang.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.

  Specified by:
    `setRequestURI` in interface `HttpRequest`
  Parameters:
    `uri` - The request URI

### setSecure

    public void setSecure(boolean secure)

  Set the flag indicating whether this Request was received on a secure communications link or not. This will normally be called by the HTTP Connector, when it parses the request headers.

  Specified by:
    `setSecure` in interface `Request`
  Overrides:
    `setSecure` in class `RequestBase`
  Parameters:
    `secure` - The new secure flag

### setServletPath

    public void setServletPath(java.lang.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.

  Specified by:
    `setServletPath` in interface `HttpRequest`
  Parameters:
    `path` - The servlet path

### setUserPrincipal

    public void setUserPrincipal(java.security.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.

  Specified by:
    `setUserPrincipal` in interface `HttpRequest`
  Parameters:
    `principal` - The user Principal

### parseParameters

    protected void parseParameters()

  Parse the parameters of this request, if it has not already occurred. If parameters are present in both the query string and the request content, they are merged.

### getParameter

    public java.lang.String getParameter(java.lang.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.

  Specified by:
    `getParameter` in interface `javax.servlet.ServletRequest`
  Specified by:
    `getParameter` in class `RequestBase`
  Parameters:
    `name` - Name of the desired request parameter

### getParameterMap

    public java.util.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.

  Specified by:
    `getParameterMap` in interface `javax.servlet.ServletRequest`
  Specified by:
    `getParameterMap` in class `RequestBase`
  Returns:
    A `Map` containing parameter names as keys and parameter values as map values.

### getParameterNames

    public java.util.Enumeration getParameterNames()

  Return the names of all defined request parameters for this request.

  Specified by:
    `getParameterNames` in interface `javax.servlet.ServletRequest`
  Specified by:
    `getParameterNames` in class `RequestBase`

### getParameterValues

    public java.lang.String[] getParameterValues(java.lang.String name)

  Return the defined values for the specified request parameter, if any; otherwise, return `null`.

  Specified by:
    `getParameterValues` in interface `javax.servlet.ServletRequest`
  Specified by:
    `getParameterValues` in class `RequestBase`
  Parameters:
    `name` - Name of the desired request parameter

### getRequestDispatcher

    public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)

  Return a RequestDispatcher that wraps the resource at the specified path, which may be interpreted as relative to the current request path.

  Specified by:
    `getRequestDispatcher` in interface `javax.servlet.ServletRequest`
  Specified by:
    `getRequestDispatcher` in class `RequestBase`
  Parameters:
    `path` - Path of the resource to be wrapped

### isSecure

    public boolean isSecure()

  Was this request received on a secure connection?

  Specified by:
    `isSecure` in interface `javax.servlet.ServletRequest`
  Overrides:
    `isSecure` in class `RequestBase`

### getAuthType

    public java.lang.String getAuthType()

  Return the authentication type used for this Request.

  Specified by:
    `getAuthType` in interface `javax.servlet.http.HttpServletRequest`

### getContextPath

    public java.lang.String getContextPath()

  Return the portion of the request URI used to select the Context of the Request.

  Specified by:
    `getContextPath` in interface `javax.servlet.http.HttpServletRequest`

### getCookies

    public javax.servlet.http.Cookie[] getCookies()

  Return the set of Cookies received with this Request.

  Specified by:
    `getCookies` in interface `javax.servlet.http.HttpServletRequest`

### getDateHeader

    public long getDateHeader(java.lang.String name)

  Return the value of the specified date header, if any; otherwise return -1.

  Specified by:
    `getDateHeader` in interface `javax.servlet.http.HttpServletRequest`
  Parameters:
    `name` - Name of the requested date header
  Throws:
    `java.lang.IllegalArgumentException` - if the specified header value cannot be converted to a date

### getHeader

    public java.lang.String getHeader(java.lang.String name)

  Return the first value of the specified header, if any; otherwise, return `null`

  Specified by:
    `getHeader` in interface `javax.servlet.http.HttpServletRequest`
  Parameters:
    `name` - Name of the requested header

### getHeaders

    public java.util.Enumeration getHeaders(java.lang.String name)

  Return all of the values of the specified header, if any; otherwise, return an empty enumeration.

  Specified by:
    `getHeaders` in interface `javax.servlet.http.HttpServletRequest`
  Parameters:
    `name` - Name of the requested header

### getHeaderNames

    public java.util.Enumeration getHeaderNames()

  Return the names of all headers received with this request.

  Specified by:
    `getHeaderNames` in interface `javax.servlet.http.HttpServletRequest`

### getIntHeader

    public int getIntHeader(java.lang.String name)

  Return the value of the specified header as an integer, or -1 if there is no such header for this request.

  Specified by:
    `getIntHeader` in interface `javax.servlet.http.HttpServletRequest`
  Parameters:
    `name` - Name of the requested header
  Throws:
    `java.lang.IllegalArgumentException` - if the specified header value cannot be converted to an integer

### getMethod

    public java.lang.String getMethod()

  Return the HTTP request method used in this Request.

  Specified by:
    `getMethod` in interface `javax.servlet.http.HttpServletRequest`

### getPathInfo

    public java.lang.String getPathInfo()

  Return the path information associated with this Request.

  Specified by:
    `getPathInfo` in interface `javax.servlet.http.HttpServletRequest`

### getPathTranslated

    public java.lang.String getPathTranslated()

  Return the extra path information for this request, translated to a real path.

  Specified by:
    `getPathTranslated` in interface `javax.servlet.http.HttpServletRequest`

### getQueryString

    public java.lang.String getQueryString()

  Return the query string associated with this request.

  Specified by:
    `getQueryString` in interface `javax.servlet.http.HttpServletRequest`

### getRemoteUser

    public java.lang.String getRemoteUser()

  Return the name of the remote user that has been authenticated for this Request.

  Specified by:
    `getRemoteUser` in interface `javax.servlet.http.HttpServletRequest`

### getRequestedSessionId

    public java.lang.String getRequestedSessionId()

  Return the session identifier included in this request, if any.

  Specified by:
    `getRequestedSessionId` in interface `javax.servlet.http.HttpServletRequest`

### getRequestURI

    public java.lang.String getRequestURI()

  Return the request URI for this request.

  Specified by:
    `getRequestURI` in interface `javax.servlet.http.HttpServletRequest`

### getRequestURL

    public java.lang.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.

  Specified by:
    `getRequestURL` in interface `javax.servlet.http.HttpServletRequest`
  Returns:
    A `StringBuffer` object containing the reconstructed URL

### getServletPath

    public java.lang.String getServletPath()

  Return the portion of the request URI used to select the servlet that will process this request.

  Specified by:
    `getServletPath` in interface `javax.servlet.http.HttpServletRequest`

### getSession

    public javax.servlet.http.HttpSession getSession()

  Return the session associated with this Request, creating one if necessary.

  Specified by:
    `getSession` in interface `javax.servlet.http.HttpServletRequest`

### getSession

    public javax.servlet.http.HttpSession getSession(boolean create)

  Return the session associated with this Request, creating one if necessary and requested.

  Specified by:
    `getSession` in interface `javax.servlet.http.HttpServletRequest`
  Parameters:
    `create` - Create a new session if one does not exist

### isRequestedSessionIdFromCookie

    public boolean isRequestedSessionIdFromCookie()

  Return `true` if the session identifier included in this request came from a cookie.

  Specified by:
    `isRequestedSessionIdFromCookie` in interface `javax.servlet.http.HttpServletRequest`

### isRequestedSessionIdFromURL

    public boolean isRequestedSessionIdFromURL()

  Return `true` if the session identifier included in this request came from the request URI.

  Specified by:
    `isRequestedSessionIdFromURL` in interface `javax.servlet.http.HttpServletRequest`

### isRequestedSessionIdFromUrl

    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.

  Specified by:
    `isRequestedSessionIdFromUrl` in interface `javax.servlet.http.HttpServletRequest`

### isRequestedSessionIdValid

    public boolean isRequestedSessionIdValid()

  Return `true` if the session identifier included in this request identifies a valid session.

  Specified by:
    `isRequestedSessionIdValid` in interface `javax.servlet.http.HttpServletRequest`

### isUserInRole

    public boolean isUserInRole(java.lang.String role)

  Return `true` if the authenticated user principal possesses the specified role name.

  Specified by:
    `isUserInRole` in interface `javax.servlet.http.HttpServletRequest`
  Parameters:
    `role` - Role name to be validated

### getUserPrincipal

    public java.security.Principal getUserPrincipal()

  Return the principal that has been authenticated for this Request.

  Specified by:
    `getUserPrincipal` in interface `javax.servlet.http.HttpServletRequest`

Copyright © 2000-2001 Apache Software Foundation. All Rights Reserved.