クラス ContextExposingHttpServletRequest

java.lang.ObjectSE
jakarta.servlet.ServletRequestWrapper
jakarta.servlet.http.HttpServletRequestWrapper
org.springframework.web.context.support.ContextExposingHttpServletRequest
実装されているすべてのインターフェース:
jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletRequest

public class ContextExposingHttpServletRequest extends jakarta.servlet.http.HttpServletRequestWrapper
特定の WebApplicationContext 内のすべての Spring Bean をリクエスト属性としてアクセス可能にする HttpServletRequest デコレーター。属性がアクセスされると遅延チェックが行われます。
導入:
2.5
作成者:
Juergen Hoeller
  • フィールドのサマリー

    インターフェース jakarta.servlet.http.HttpServletRequest から継承されたフィールド

    BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
  • コンストラクターの概要

    コンストラクター
    コンストラクター
    説明
    ContextExposingHttpServletRequest(jakarta.servlet.http.HttpServletRequest originalRequest, WebApplicationContext context)
    指定されたリクエストに対して新しい ContextExposingHttpServletRequest を作成します。
    ContextExposingHttpServletRequest(jakarta.servlet.http.HttpServletRequest originalRequest, WebApplicationContext context, @Nullable SetSE<StringSE> exposedContextBeanNames)
    指定されたリクエストに対して新しい ContextExposingHttpServletRequest を作成します。
  • メソッドのサマリー

    修飾子と型
    メソッド
    説明
    このリクエストが実行される WebApplicationContext を返します。
    void

    クラス jakarta.servlet.http.HttpServletRequestWrapper から継承されたメソッド

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

    クラス jakarta.servlet.ServletRequestWrapper から継承されたメソッド

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

    クラス ObjectSE から継承されたメソッド

    clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE

    インターフェース jakarta.servlet.ServletRequest から継承されたメソッド

    getAsyncContext, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getProtocolRequestId, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setCharacterEncoding, setCharacterEncoding, startAsync, startAsync
  • コンストラクターの詳細

    • ContextExposingHttpServletRequest

      public ContextExposingHttpServletRequest(jakarta.servlet.http.HttpServletRequest originalRequest, WebApplicationContext context)
      指定されたリクエストに対して新しい ContextExposingHttpServletRequest を作成します。
      パラメーター:
      originalRequest - オリジナルの HttpServletRequest
      context - このリクエストが実行される WebApplicationContext
    • ContextExposingHttpServletRequest

      public ContextExposingHttpServletRequest(jakarta.servlet.http.HttpServletRequest originalRequest, WebApplicationContext context, @Nullable SetSE<StringSE> exposedContextBeanNames)
      指定されたリクエストに対して新しい ContextExposingHttpServletRequest を作成します。
      パラメーター:
      originalRequest - オリジナルの HttpServletRequest
      context - このリクエストが実行される WebApplicationContext
      exposedContextBeanNames - 公開されるはずのコンテキスト内の Bean の名前 (これが null 以外の場合、このセットの Bean のみが属性として公開の対象になります)
  • メソッドの詳細

    • getWebApplicationContext

      public final WebApplicationContext getWebApplicationContext()
      このリクエストが実行される WebApplicationContext を返します。
    • getAttribute

      public @Nullable ObjectSE getAttribute(StringSE name)
      次で指定:
      インターフェース jakarta.servlet.ServletRequestgetAttribute 
      オーバーライド:
      クラス jakarta.servlet.ServletRequestWrappergetAttribute 
    • setAttribute

      public void setAttribute(StringSE name, ObjectSE value)
      次で指定:
      インターフェース jakarta.servlet.ServletRequestsetAttribute 
      オーバーライド:
      クラス jakarta.servlet.ServletRequestWrappersetAttribute