Today i got one of the requirment to get the binding of some component which is binding in another managed bean.
This is something tedious requirment i have.. Well in JSF 2.0 you can get very easily by using below code
FacesContext context = FacesContext.getCurrentInstance(); BEAN bean = (RegionNavigationListener)context.getApplication().evaluateExpressionGet(context, "#{BEAN}", BEAN.class);
You can write above code as below as well
FacesContext fctx = FacesContext.getCurrentInstance(); Application application = fctx.getApplication(); ExpressionFactory expressionFactory = application.getExpressionFactory(); ELContext context = fctx.getELContext(); ValueExpression createValueExpression = expressionFactory.createValueExpression(context, "#{pageFlowScope.PageFlowScopeBean}",PageFlowScopeClass.class); PageFlowScopeClass pageFlowScopeInstance =(PageFlowScopeClass) createValueExpression.getValue(context);