Get JSF managed bean by name in any Servlet related class
In a servlet based artifact, such as @WebServlet, @WebFilter and @WebListener, you can grab a “plain vanilla” JSF @ManagedBean @RequestScoped by: Bean bean = (Bean) request.getAttribute(“beanName”); and @ManagedBean @SessionScoped by: Bean bean = (Bean) request.getSession().getAttribute(“beanName”); and @ManagedBean @ApplicationScoped by: Bean bean = (Bean) getServletContext().getAttribute(“beanName”); Note that this prerequires that the bean is already autocreated by … Read more