基本的にここと同じ質問
別のブラウザー タブにリダイレクトするページで ViewScoped Bean を保持するにはどうすればよいですか。
firstPage.xhtml:
<h:commandLink action="#{controller.redirect}" value="#{bean.value} target="_blank"/>
リダイレクト/ナビゲーションが他の Bean の初期化で終了すると、プロセスでこの #{bean} を破棄します。リダイレクトされたコードでは、#{bean} も使用していません。これは以前は
<a4j:keepAlive>
これが私の現在のセットアップです。豆クラス:
@ViewScoped
public class Bean{
@PreDestroy
public void onDestroy(){ // being destroyed when I don't want to }
}
顔構成:
<navigation-rule>
<from-view-id>/firstPage.xhtml</from-view-id>
<navigation-case>
<from-outcome>redirect</from-outcome>
<to-view-id>/secondPage.xhtml</to-view-id>
</navigation-case>
</navigation-rule>