Websphere Process Server(WAS 7の上)にViewExpiredExceptionのあるJSFページがあります。これが発生した場合、ユーザーをログアウトしてから再度ログインさせたいので、web.xmlでこの例外のリダイレクトを次のログアウトページに設定しました。
<%
session.invalidate();
response.sendRedirect("ibm_security_logout?logoutExitPage=/faces/ToDosOpen.jsp");
%>
次に、ログインページにリダイレクトします。
<%@ page import="com.ibm.wbit.tel.client.jsf.infrastructure.Messages, java.util.Locale" language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%
String contextPath = request.getContextPath();
Locale locale = request.getLocale();
final String SECURITY_CHECK = "j_security_check";
%>
...
</head>
<body>
...
<h1><%= Messages.getString("LOGIN_LINE", locale) %></h1>
<div class="help-text"><%= Messages.getString("LOGIN_LINE_DESCR", locale) %></div>
<form target="_top" method="POST" action=<%= SECURITY_CHECK %>>
<table id="login-form">
<tr>
<td><%= Messages.getString("LOGIN_NAME", locale) %>:</td>
<td><input type="text" name="j_username"></td>
</tr>
<tr>
<td><%= Messages.getString("LOGIN_PASSWORD", locale) %>:</td>
<td><input type="password" name="j_password"></td>
</tr>
<tr>
<td id="login-button" colspan="2">
<input type="submit" name="login" value="
<%= Messages.getString("BUTTON_LOGIN", locale) %>"></td>
</tr>
</table>
</form>
そして、ログインすると、そもそも例外の原因となったページにリダイレクトされます。実際に発生することを除いて、例外が再度スローされ、ログインページに戻ります。
したがって、2回ログインする必要があります。
これについて何をすべきか、どこから探し始めるかわからない。どんな助けでもいただければ幸いです。私はこれに関する既存の質問を調べましたが、それを解決することができませんでした。
編集:例外をトリガーしたアクションが更新の場合は正常に機能しますが、アクションがコマンドバーをクリックした場合は失敗します(2回ログインする必要があります)。