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
You can get the managed bean by passing the name:
public static Object getBean(String beanName){
Object bean = null;
FacesContext fc = FacesContext.getCurrentInstance();
if(fc!=null){
ELContext elContext = fc.getELContext();
bean = elContext.getELResolver().getValue(elContext, null, beanName);
}
return bean;
}