クラス ContentCachingRequestWrapper
java.lang.ObjectSE
jakarta.servlet.ServletRequestWrapper
jakarta.servlet.http.HttpServletRequestWrapper
org.springframework.web.util.ContentCachingRequestWrapper
- 実装されているすべてのインターフェース:
HttpServletRequestEE,ServletRequestEE
入力ストリームおよびリーダーから読み取られたすべてのコンテンツをキャッシュし、
byte array を介してこのコンテンツを取得できるようにする HttpServletRequestEE ラッパー。 このクラスは、コンテンツの読み取り時にのみコンテンツをキャッシュするインターセプターとして機能しますが、それ以外の場合はコンテンツが読み取られません。つまり、リクエストコンテンツが消費されない場合、コンテンツはキャッシュされず、getContentAsByteArray() を介して取得できません。
たとえば、AbstractRequestLoggingFilter によって使用されます。
- 導入:
- 4.1.3
- 作成者:
- Juergen Hoeller, Brian Clozel
- 関連事項:
フィールドのサマリー
インターフェース jakarta.servlet.http.HttpServletRequestEE から継承されたフィールド
BASIC_AUTHEE, CLIENT_CERT_AUTHEE, DIGEST_AUTHEE, FORM_AUTHEEコンストラクターの概要
コンストラクターコンストラクター説明指定されたサーブレットリクエストに対して新しい ContentCachingRequestWrapper を作成します。ContentCachingRequestWrapper(HttpServletRequestEE request, int contentCacheLimit) 指定されたサーブレットリクエストに対して新しい ContentCachingRequestWrapper を作成します。メソッドのサマリー
修飾子と型メソッド説明byte[]キャッシュされたリクエストコンテンツをバイト配列として返します。構成されたCharsetSE を使用して、キャッシュされたリクエストのコンテンツを文字列として返します。getParameter(StringSE name) StringSE[]getParameterValues(StringSE name) protected voidhandleContentOverflow(int contentCacheLimit) コンテンツオーバーフローを処理するためのテンプレートメソッド: 具体的には、指定されたコンテンツキャッシュの制限を超えて読み取られるリクエスト本文。クラス jakarta.servlet.http.HttpServletRequestWrapperEE から継承されたメソッド
authenticateEE, changeSessionIdEE, getAuthTypeEE, getContextPathEE, getCookiesEE, getDateHeaderEE, getHeaderEE, getHeaderNamesEE, getHeadersEE, getHttpServletMappingEE, getIntHeaderEE, getMethodEE, getPartEE, getPartsEE, getPathInfoEE, getPathTranslatedEE, getQueryStringEE, getRemoteUserEE, getRequestedSessionIdEE, getRequestURIEE, getRequestURLEE, getServletPathEE, getSessionEE, getSessionEE, getTrailerFieldsEE, getUserPrincipalEE, isRequestedSessionIdFromCookieEE, isRequestedSessionIdFromURLEE, isRequestedSessionIdValidEE, isTrailerFieldsReadyEE, isUserInRoleEE, loginEE, logoutEE, newPushBuilderEE, upgradeEEクラス jakarta.servlet.ServletRequestWrapperEE から継承されたメソッド
getAsyncContextEE, getAttributeEE, getAttributeNamesEE, getContentLengthEE, getContentLengthLongEE, getContentTypeEE, getDispatcherTypeEE, getLocalAddrEE, getLocaleEE, getLocalesEE, getLocalNameEE, getLocalPortEE, getProtocolEE, getProtocolRequestIdEE, getRemoteAddrEE, getRemoteHostEE, getRemotePortEE, getRequestEE, getRequestDispatcherEE, getRequestIdEE, getSchemeEE, getServerNameEE, getServerPortEE, getServletConnectionEE, getServletContextEE, isAsyncStartedEE, isAsyncSupportedEE, isSecureEE, isWrapperForEE, isWrapperForEE, removeAttributeEE, setAttributeEE, setCharacterEncodingEE, setRequestEE, startAsyncEE, startAsyncEEクラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース jakarta.servlet.ServletRequestEE から継承されたメソッド
getAsyncContextEE, getAttributeEE, getAttributeNamesEE, getContentLengthEE, getContentLengthLongEE, getContentTypeEE, getDispatcherTypeEE, getLocalAddrEE, getLocaleEE, getLocalesEE, getLocalNameEE, getLocalPortEE, getProtocolEE, getProtocolRequestIdEE, getRemoteAddrEE, getRemoteHostEE, getRemotePortEE, getRequestDispatcherEE, getRequestIdEE, getSchemeEE, getServerNameEE, getServerPortEE, getServletConnectionEE, getServletContextEE, isAsyncStartedEE, isAsyncSupportedEE, isSecureEE, removeAttributeEE, setAttributeEE, setCharacterEncodingEE, startAsyncEE, startAsyncEE
コンストラクターの詳細
ContentCachingRequestWrapper
指定されたサーブレットリクエストに対して新しい ContentCachingRequestWrapper を作成します。- パラメーター:
request- 元のサーブレットリクエスト
ContentCachingRequestWrapper
指定されたサーブレットリクエストに対して新しい ContentCachingRequestWrapper を作成します。- パラメーター:
request- 元のサーブレットリクエストcontentCacheLimit- リクエストごとにキャッシュする最大バイト数- 導入:
- 4.3.6
- 関連事項:
メソッドの詳細
getInputStream
- 次で指定:
- インターフェース
ServletRequestEEのgetInputStreamEE - オーバーライド:
- クラス
ServletRequestWrapperEEのgetInputStreamEE - 例外:
IOExceptionSE
getCharacterEncoding
- 次で指定:
- インターフェース
ServletRequestEEのgetCharacterEncodingEE - オーバーライド:
- クラス
ServletRequestWrapperEEのgetCharacterEncodingEE
getReader
- 次で指定:
- インターフェース
ServletRequestEEのgetReaderEE - オーバーライド:
- クラス
ServletRequestWrapperEEのgetReaderEE - 例外:
IOExceptionSE
getParameter
- 次で指定:
- インターフェース
ServletRequestEEのgetParameterEE - オーバーライド:
- クラス
ServletRequestWrapperEEのgetParameterEE
getParameterMap
- 次で指定:
- インターフェース
ServletRequestEEのgetParameterMapEE - オーバーライド:
- クラス
ServletRequestWrapperEEのgetParameterMapEE
getParameterNames
- 次で指定:
- インターフェース
ServletRequestEEのgetParameterNamesEE - オーバーライド:
- クラス
ServletRequestWrapperEEのgetParameterNamesEE
getParameterValues
- 次で指定:
- インターフェース
ServletRequestEEのgetParameterValuesEE - オーバーライド:
- クラス
ServletRequestWrapperEEのgetParameterValuesEE
getContentAsByteArray
public byte[] getContentAsByteArray()キャッシュされたリクエストコンテンツをバイト配列として返します。返される配列がコンテンツキャッシュの制限を超えることはありません。
注意 : このメソッドから返されるバイト配列は、呼び出された時点で読み取られたコンテンツの量を反映しています。アプリケーションがコンテンツを読み取らない場合、このメソッドは空の配列を返します。
getContentAsString
構成されたCharsetSE を使用して、キャッシュされたリクエストのコンテンツを文字列として返します。注意 : このメソッドから返される文字列は、呼び出し時に読み取られたコンテンツの量を反映します。アプリケーションがコンテンツを読み取らない場合、このメソッドは空の文字列を返します。
- 導入:
- 6.1
- 関連事項:
handleContentOverflow
protected void handleContentOverflow(int contentCacheLimit) コンテンツオーバーフローを処理するためのテンプレートメソッド: 具体的には、指定されたコンテンツキャッシュの制限を超えて読み取られるリクエスト本文。デフォルトの実装は空です。サブクラスはこれをオーバーライドして、ペイロードが大きすぎる例外などをスローします。
- パラメーター:
contentCacheLimit- 超過したリクエストごとのキャッシュする最大バイト数- 導入:
- 4.3.6
- 関連事項: