0
Page foo.xhtml
--------------    
<f:view transient="#{fooBean.transient}">
    ...
</f:view>


@ViewScoped("fooBean")
public class FooBean {
   private boolean _transient = false;

   public void setTransient(boolean t) {
      _transient = t;
   }

   public boolean isTransient() {
      return _transient;
   }
}

ページ bar.xhtml の呼び出しアプリケーション中に、fooBean が作成され、fooBean.setTransient(true)、デフォルトは false です。次に、ページ foo.xhml に移動します。ページ foo.xhtml で、アプリケーションの呼び出し段階で作成された fooBean を使用する方法を教えてください。

preRenderEvent を使用して fooBean を管理するように設定しようとしました

FacesContext context = FacesContext.getCurrentInstance();
context.getApplication ().getELResolver().setValue(context.getELContext(), null, "fooBean", fooBean);

しかし、手遅れです。の間に UIViewRoot.transient が設定されましbuildView()た。JSFで管理するように設定できるように、buildView()呼び出す前にコールバックがあるかどうか疑問に思っています。#{fooBean.transient}fooBean

手伝ってくれてありがとう。

4

0 に答える 0