Tuckey URLRewriteFilterを使用しています。私のアプリケーションには、次のページとボタンがあります。
inside.xhtmlアプリのコンテキスト内にあるページ: http://example.com/app/inside.xhtmloutside.xhtmlアプリのコンテキスト外のページ: http://example.com/outside.xhtml- http://example.com/app/login.xhtml
login.xhtmlのページ - ページに移動するためのページ
login button上の A。outside.xhtmllogin.xhtml - http://example.com/app/profile.xhtml
profile.xhtmlのページ - ページに移動するためのページ
logout button上の A。profile.xhtmlinside.xhtml
ファイルには、からにumlrewrite.xhtmlリダイレクトする次のルールがあります。inside.xhtmloutside.xhtml
<rule>
<note>
Requests to /app/inside.xhtml will be redirected to ./../../outside.html
</note>
<from>/app/inside.xhtml</from>
<to type="redirect">./../../outside.html</to>
</rule>
私の論理では、ユーザーがページにログインした後、ユーザーはlogin.xhtmlページにリダイレクトされprofile.xhtmlます。私が期待しているのは、次の流れです。
- にサーフィンし
outside.xhtmlます。 - クリック
login buttonしてアクセスしlogin.xhtml、ログインしてください。 profile.xhtmlログイン成功で到着。- をクリック
logout buttonして に移動しinside.xhtmlます。 - にリダイレクトされ
outside.xhtmlます。
ただし、実際には次のようになります。
- にサーフィンし
outside.xhtmlます。 - クリック
login buttonしてアクセスしlogin.xhtml、ログインしてください。 - 突然 にリダイレクトされ
outside.xhtmlます。 - クリック
login buttonしてlogin.xhtml再度ログインします (アプリはログインを記録しませんでした)。 profile.xhtmlログイン成功で到着。- をクリック
logout buttonして に移動しinside.xhtmlます。 - にリダイレクトされ
outside.xhtmlます。
2上記の状況は、ステップごとに実行し続けると繰り返し発生します7。
それがなければ、ログインに成功すると常にページに正しく<rule>リダイレクトされます。profile.xhtml
この問題について何かアドバイスをいただければ幸いです。
アップデート:
私のアプリでは、logged in状態を追跡するために、状態@SessionScopedを記録する簡単なメソッドを含むマネージド Bean があります。
public void recordUserLoggedIn(HttpServletRequest request) {
HttpSession clientSession = request.getSession();
clientSession.setAttribute("isLogin", true);
}