Saturday, December 31, 2011
Wednesday, December 28, 2011
Accessing another managed Bean
The Two method Suppose I want to access the login bean from welcome bean.
1) Using the Value Binding
FacesContext fc = FacesContext.getCurrentInstance();
LoginBean loginBean = (LoginBean) fc.getApplication().createValueBinding("# {login}").getValue(fc);
2) Using the Variable Resolver
FacesContext fc = FacesContext.getCurrentInstance();
LoginBean loginBean = (LoginBean) fc.getApplication().getVariableResolver().resolveVariable(fc, "login");
Posted by Sajjad at 11:43 am 0 comments
Labels: JSF
Subscribe to:
Posts (Atom)