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 had same requirement.
I have used the below way to get it.
I had session scoped bean.
@ManagedBean(name="mb")
@SessionScopedpublic
class ManagedBean {
--------
}
I have used the below code in my servlet doPost() method.
ManagedBean mb = (ManagedBean) request.getSession().getAttribute("mb");
it solved my problem.