You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2005/11/14 17:56:27 UTC

[Myfaces Wiki] Update of "FAQ" by MikeKienenberger

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by MikeKienenberger:
http://wiki.apache.org/myfaces/FAQ

The comment on the change is:
Added createValueBinding("#{neededBean}").getValue example

------------------------------------------------------------------------------
  {{{
  FacesContext facesContext = FacesContext.getCurrentInstance();
  NeededBean neededBean
-     = (NeededBean) facesContext.getApplication().getVariableResolver()
+     = (NeededBean) facesContext.getApplication()
-       .resolveVariable(facesContext, "neededBean");
+       .getVariableResolver().resolveVariable(facesContext, "neededBean");
+ }}}
+ Alternately, you can use this code to evaluate any JSF EL expression.
+ {{{
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ NeededBean neededBean
+     = (NeededBean)facesContext.getApplication()
+       .createValueBinding("#{neededBean}").getValue(facesContext);
  }}}