クラス DefaultRedirectStrategy

  • 実装されたすべてのインターフェース:
    RedirectStrategy

    public class DefaultRedirectStrategy
    extends java.lang.Object
    implements RedirectStrategy
    フレームワーク全体で使用されるデフォルトである RedirectStrategy の単純な実装。
    導入:
    3.0
    • フィールドサマリー

      フィールド  
      修飾子と型 フィールド 説明
      protected org.apache.commons.logging.Loglogger
    • コンストラクターのサマリー

      コンストラクター  
      コンストラクター 説明
      DefaultRedirectStrategy()
    • メソッドのサマリー

      すべてのメソッド   インスタンスメソッド   具象メソッド  
      修飾子と型 メソッド 説明
      protected java.lang.StringcalculateRedirectUrl​(java.lang.String contextPath, java.lang.String url)
      protected booleanisContextRelative()
      リダイレクト URL からプロトコルとコンテキストパスを引いて計算する必要がある場合(デフォルトは false )、 true を返します。
      voidsendRedirect​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String url)
      指定された URL にレスポンスをリダイレクトします。
      voidsetContextRelative​(boolean useRelativeContext)
      true の場合、リダイレクト URL からプロトコルとコンテキストパスを除いて計算されます(デフォルトは false )。
      • クラス java.lang.Object から継承されたメソッド

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • フィールドの詳細

      • logger

        protected final org.apache.commons.logging.Log logger
    • コンストラクターの詳細

      • DefaultRedirectStrategy

        public DefaultRedirectStrategy()
    • メソッドの詳細

      • sendRedirect

        public void sendRedirect​(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 java.lang.String url)
                          throws java.io.IOException
        指定された URL にレスポンスをリダイレクトします。

        contextRelative が設定されている場合、リダイレクト値はリクエストコンテキストパスの後の値になります。これによりプロトコル情報 (HTTP または HTTPS) が失われるため、たとえば HTTPS に変更するためにリダイレクトが実行される場合に問題が発生することに注意してください。

        次で指定:
        インターフェース RedirectStrategysendRedirect 
        パラメーター:
        request - 現在のリクエスト
        response - リダイレクトするレスポンス
        url - リダイレクト先のターゲット URL、たとえば "/login"
        例外:
        java.io.IOException
      • calculateRedirectUrl

        protected java.lang.String calculateRedirectUrl​(java.lang.String contextPath,
                                                        java.lang.String url)
      • setContextRelative

        public void setContextRelative​(boolean useRelativeContext)
        true の場合、リダイレクト URL からプロトコルとコンテキストパスを除いて計算されます(デフォルトは false )。
      • isContextRelative

        protected boolean isContextRelative()
        リダイレクト URL からプロトコルとコンテキストパスを引いて計算する必要がある場合(デフォルトは false )、 true を返します。