I\'m trying to write a custom servlet (for AJAX/JSON) in which I would like to reference my @ManagedBeans
by name. I\'m hoping to map:
http://host
I use the following method:
public static T getBean(final String beanName, final Class clazz) {
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
return (T) FacesContext.getCurrentInstance().getApplication().getELResolver().getValue(elContext, null, beanName);
}
This allows me to get the returned object in a typed manner.