Shahzeb
Shahzeb

Reputation: 4785

How can I get all the initialized managed beans in the session?

How can I get all the initialized managed beans in the session? Following code crashes the JVM every time.

FacesContext facesContext=FacesContext.getCurrentInstance();
com.sun.faces.application.ApplicationAssociate application = 
ApplicationAssociate.getInstance(facesContext.getExternalContext());

Upvotes: 0

Views: 129

Answers (1)

Petr Mensik
Petr Mensik

Reputation: 27496

Can't you use something like

 FacesContext context = FacesContext.getCurrentInstance();
 HttpSession session = (HttpSession) context.getExternalContext().getSession(true);
 Enumeration mySessionBeans = session.getAttributeNames();

Upvotes: 1

Related Questions