use of javax.faces.el.ValueBinding in project ma-core-public by infiniteautomation.
the class JsfCreator method getInstance.
/* (non-Javadoc)
* @see org.directwebremoting.Creator#getInstance()
*/
public Object getInstance() throws InstantiationException {
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext == null) {
log.error("Object " + getManagedBeanName() + " cannot be created since the faces context is null");
return null;
}
Application application = facesContext.getApplication();
Object resolvedObject = null;
if (isVBExpression(getManagedBeanName())) {
ValueBinding vb = application.createValueBinding(getManagedBeanName());
if (vb != null) {
resolvedObject = vb.getValue(facesContext);
}
} else {
VariableResolver resolver = application.getVariableResolver();
resolvedObject = resolver.resolveVariable(facesContext, getManagedBeanName());
}
return resolvedObject;
}
Aggregations