public class SimpleUrlAuthenticationFailureHandler extends java.lang.Object implements AuthenticationFailureHandler
defaultFailureUrl プロパティの値へのリダイレクトを実行します。プロパティが設定されていない場合は、失敗の原因となった AuthenticationException からのエラーメッセージとともに、401 レスポンスがクライアントに送信されます。useForward プロパティが設定されている場合、リダイレクトではなく、宛先に対して RequestDispatcher.forward 呼び出しが行われます。
| 修飾子と型 | フィールドと説明 |
|---|---|
protected org.apache.commons.logging.Log | logger |
| コンストラクターと説明 |
|---|
SimpleUrlAuthenticationFailureHandler() |
SimpleUrlAuthenticationFailureHandler(java.lang.String defaultFailureUrl) |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected RedirectStrategy | getRedirectStrategy() |
protected boolean | isAllowSessionCreation() |
protected boolean | isUseForward() |
void | onAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException exception) 設定されている場合、 defaultFailureUrl へのリダイレクトまたは転送を実行します。それ以外の場合は、401 エラーコードを返します。 |
protected void | saveException(javax.servlet.http.HttpServletRequest request, AuthenticationException exception) ビューのレンダリングで使用するために AuthenticationException をキャッシュします。 |
void | setAllowSessionCreation(boolean allowSessionCreation) |
void | setDefaultFailureUrl(java.lang.String defaultFailureUrl) 失敗の宛先として使用される URL。 |
void | setRedirectStrategy(RedirectStrategy redirectStrategy) ターゲット URL にリダイレクトするときの動作をオーバーライドできます。 |
void | setUseForward(boolean forwardToDestination) true に設定されている場合、リダイレクトではなく、失敗した宛先 URL への転送を実行します。 |
public SimpleUrlAuthenticationFailureHandler()
public SimpleUrlAuthenticationFailureHandler(java.lang.String defaultFailureUrl)
public void onAuthenticationFailure(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
AuthenticationException exception)
throws java.io.IOException,
javax.servlet.ServletExceptiondefaultFailureUrl へのリダイレクトまたは転送を実行します。それ以外の場合は、401 エラーコードを返します。 リダイレクトまたは転送する場合、saveException が呼び出され、例外をキャッシュしてターゲットビューで使用します。
AuthenticationFailureHandler 内の onAuthenticationFailure request - 認証試行が発生したリクエスト。response - レスポンス。exception - 認証リクエストを拒否するためにスローされた例外。java.io.IOExceptionjavax.servlet.ServletExceptionprotected final void saveException(javax.servlet.http.HttpServletRequest request,
AuthenticationException exception)AuthenticationException をキャッシュします。forwardToDestination が true に設定されている場合、リクエストスコープが使用されます。それ以外の場合は、セッションに例外を格納しようとします。セッションがなく、allowSessionCreation が true の場合、セッションが作成されます。そうでない場合、例外は保存されません。
public void setDefaultFailureUrl(java.lang.String defaultFailureUrl)
defaultFailureUrl - 障害 URL、たとえば "/loginFailed.jsp"。protected boolean isUseForward()
public void setUseForward(boolean forwardToDestination)
public void setRedirectStrategy(RedirectStrategy redirectStrategy)
protected RedirectStrategy getRedirectStrategy()
protected boolean isAllowSessionCreation()
public void setAllowSessionCreation(boolean allowSessionCreation)