public class ExceptionMappingAuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler
一致が見つからない場合は、親クラス SimpleUrlAuthenticationFailureHandler の動作にフォールバックします。
例外名と URL のマップは、exceptionMappings プロパティを設定して挿入する必要があります。
logger| コンストラクターと説明 |
|---|
ExceptionMappingAuthenticationFailureHandler() |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | onAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException exception) 設定されている場合、 defaultFailureUrl へのリダイレクトまたは転送を実行します。それ以外の場合は、401 エラーコードを返します。 |
void | setExceptionMappings(java.util.Map<?,?> failureUrlMap) 例外型のマップを(名前で)URL に設定します。 |
getRedirectStrategy, isAllowSessionCreation, isUseForward, saveException, setAllowSessionCreation, setDefaultFailureUrl, setRedirectStrategy, setUseForwardpublic ExceptionMappingAuthenticationFailureHandler()
public void onAuthenticationFailure(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
AuthenticationException exception)
throws java.io.IOException,
javax.servlet.ServletExceptionSimpleUrlAuthenticationFailureHandlerdefaultFailureUrl へのリダイレクトまたは転送を実行します。それ以外の場合は、401 エラーコードを返します。 リダイレクトまたは転送する場合、saveException が呼び出され、例外をキャッシュしてターゲットビューで使用します。
AuthenticationFailureHandler 内の onAuthenticationFailure SimpleUrlAuthenticationFailureHandler の onAuthenticationFailure request - 認証試行が発生したリクエスト。response - レスポンス。exception - 認証リクエストを拒否するためにスローされた例外。java.io.IOExceptionjavax.servlet.ServletExceptionpublic void setExceptionMappings(java.util.Map<?,?> failureUrlMap)
failureUrlMap - 例外クラスの完全修飾名をキーとし、対応する失敗 URL を値として持つマップ。java.lang.IllegalArgumentException - エントリが文字列でない場合、または URL が無効な場合。