HttpServletRequestWrapper (Apache Tomcat 8.5.43 API Documentation)

org.apache.catalina.servlet4preview.http

## Class HttpServletRequestWrapper

- java.lang.Object
- - javax.servlet.ServletRequestWrapper
  - - javax.servlet.http.HttpServletRequestWrapper
    - - org.apache.catalina.servlet4preview.http.HttpServletRequestWrapper

- All Implemented Interfaces:
    HttpServletRequest, ServletRequest

      public class HttpServletRequestWrapper
      extends HttpServletRequestWrapper
      implements HttpServletRequest

  Provides early access to some parts of the proposed Servlet 4.0 API.

- - ### Field Summary

    - ### Fields inherited from interface javax.servlet.http.HttpServletRequest

      `BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpServletRequestWrapper(HttpServletRequest request)` Constructs a request object wrapping the given request.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ServletMapping` | `getServletMapping()` The default behavior of this method is to return `HttpServletRequest.getServletMapping()` on the wrapped request object.
    `PushBuilder` | `newPushBuilder()` Obtain a builder for generating push requests.

    - ### Methods inherited from class javax.servlet.http.HttpServletRequestWrapper

      `authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout, upgrade`

    - ### Methods inherited from class javax.servlet.ServletRequestWrapper

      `getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface javax.servlet.http.HttpServletRequest

      `authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout, upgrade`

    - ### Methods inherited from interface javax.servlet.ServletRequest

      `getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync`

- - ### Constructor Detail

    - #### HttpServletRequestWrapper

          public HttpServletRequestWrapper(HttpServletRequest request)

      Constructs a request object wrapping the given request.
      Parameters:
        `request` - The request to wrap
      Throws:
        `java.lang.IllegalArgumentException` - if the request is null

  - ### Method Detail

    - #### getServletMapping

          public ServletMapping getServletMapping()

      The default behavior of this method is to return `HttpServletRequest.getServletMapping()` on the wrapped request object.

      Since:
        Servlet 4.0

    - #### newPushBuilder

          public PushBuilder newPushBuilder()

      Obtain a builder for generating push requests. `PushBuilder` documents how this request will be used as the basis for a push request. Each call to this method will return a new instance, independent of any previous instance obtained.

      The default behavior of this method is to return `HttpServletRequest.newPushBuilder()` on the wrapped request object.

      Returns:
        A builder that can be used to generate push requests based on this request or `null` if push is not supported. Note that even if a PushBuilder instance is returned, by the time that `PushBuilder.push()` is called, it may no longer be valid to push a request and the push request will be ignored.
      Since:
        Servlet 4.0

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