クラス SaveContextOnUpdateOrErrorResponseWrapper
java.lang.ObjectSE
jakarta.servlet.ServletResponseWrapper
jakarta.servlet.http.HttpServletResponseWrapper
org.springframework.security.web.util.OnCommittedResponseWrapper
org.springframework.security.web.context.SaveContextOnUpdateOrErrorResponseWrapper
- 実装されているすべてのインターフェース:
jakarta.servlet.http.HttpServletResponse,jakarta.servlet.ServletResponse
@DeprecatedSE
public abstract class SaveContextOnUpdateOrErrorResponseWrapper
extends OnCommittedResponseWrapper
使用すべきではありません。
セキュリティコンテキストを格納するためのロジックをカプセル化し、この
SaveContextOnUpdateOrErrorResponseWrapper が作成されたのと同じスレッドで sendError()、sendRedirect、getOutputStream().close()、getOutputStream().flush()、getWriter().close() または getWriter().flush() が発生したときに SecurityContext を格納するレスポンスラッパーの基本クラス。SEC-398 および SEC-2005 の課題を参照してください。 サブクラスは saveContext(SecurityContext context) メソッドを実装する必要があります。
URL 書き換えを無効にするためのサポートも提供されます
- 導入:
- 3.0
フィールドのサマリー
インターフェース jakarta.servlet.http.HttpServletResponse から継承されたフィールド
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXYコンストラクターの概要
コンストラクターコンストラクター説明SaveContextOnUpdateOrErrorResponseWrapper(jakarta.servlet.http.HttpServletResponse response, boolean disableUrlRewriting) 使用すべきではありません。メソッドのサマリー
修飾子と型メソッド説明void使用すべきではありません。このメソッドを呼び出して、HttpServletResponseがコミットされたときにSecurityContextの自動保存を無効にします。final StringSE使用すべきではありません。final StringSE使用すべきではありません。final boolean使用すべきではありません。このラッパーが原因でレスポンスラッパーがsaveContext()を呼び出したかどうかを示します。protected void使用すべきではありません。()が呼び出されていない限り、 SecurityContextHolder の現在の内容でsaveContext()を呼び出します。protected abstract voidsaveContext(SecurityContext context) 使用すべきではありません。セキュリティコンテキストを格納するためのロジックを実装します。voidsetSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) 使用すべきではありません。使用するSecurityContextHolderStrategyを設定します。クラス org.springframework.security.web.util.OnCommittedResponseWrapper から継承されたメソッド
addHeader, disableOnResponseCommitted, flushBuffer, getOutputStream, getWriter, isDisableOnResponseCommitted, sendError, sendError, sendRedirect, setContentLength, setContentLengthLongクラス jakarta.servlet.http.HttpServletResponseWrapper から継承されたメソッド
addCookie, addDateHeader, addIntHeader, containsHeader, getHeader, getHeaderNames, getHeaders, getStatus, getTrailerFields, setDateHeader, setHeader, setIntHeader, setStatus, setTrailerFieldsクラス jakarta.servlet.ServletResponseWrapper から継承されたメソッド
getBufferSize, getCharacterEncoding, getContentType, getLocale, getResponse, isCommitted, isWrapperFor, isWrapperFor, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentType, setLocale, setResponseクラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース jakarta.servlet.ServletResponse から継承されたメソッド
getBufferSize, getCharacterEncoding, getContentType, getLocale, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentType, setLocale
コンストラクターの詳細
SaveContextOnUpdateOrErrorResponseWrapper
public SaveContextOnUpdateOrErrorResponseWrapper(jakarta.servlet.http.HttpServletResponse response, boolean disableUrlRewriting) 使用すべきではありません。- パラメーター:
response- ラップされるレスポンスdisableUrlRewriting- URL エンコードメソッドを null 操作に変換し、URL 書き換えを使用してセッション ID を URL パラメーターとして追加することを防ぎます。
メソッドの詳細
setSecurityContextHolderStrategy
public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) 使用すべきではありません。使用するSecurityContextHolderStrategyを設定します。デフォルトのアクションは、SecurityContextHolderに格納されているSecurityContextHolderStrategyを使用することです。- 導入:
- 5.8
disableSaveOnResponseCommitted
public void disableSaveOnResponseCommitted()使用すべきではありません。このメソッドを呼び出して、HttpServletResponseがコミットされたときにSecurityContextの自動保存を無効にします。これは、SecurityContextが含まれなくなった可能性のある非同期 Web リクエストが行われた場合に役立ちます。saveContext
使用すべきではありません。セキュリティコンテキストを格納するためのロジックを実装します。- パラメーター:
context- 保存する SecurityContext インスタンス
onResponseCommitted
protected void onResponseCommitted()使用すべきではありません。()が呼び出されていない限り、 SecurityContextHolder の現在の内容でsaveContext()を呼び出します。- 次で指定:
- クラス
OnCommittedResponseWrapperのonResponseCommitted
encodeRedirectURL
使用すべきではありません。- 次で指定:
- インターフェース
jakarta.servlet.http.HttpServletResponseのencodeRedirectURL - オーバーライド:
- クラス
jakarta.servlet.http.HttpServletResponseWrapperのencodeRedirectURL
encodeURL
使用すべきではありません。- 次で指定:
- インターフェース
jakarta.servlet.http.HttpServletResponseのencodeURL - オーバーライド:
- クラス
jakarta.servlet.http.HttpServletResponseWrapperのencodeURL
isContextSaved
public final boolean isContextSaved()使用すべきではありません。このラッパーが原因でレスポンスラッパーがsaveContext()を呼び出したかどうかを示します。
SecurityContextRepository.loadDeferredContext(HttpServletRequest)を使用してください。