How to get the whole beans session in JSF 2?

As far as I know, JSF saves the entire scope bean session on some map (correct me if I'm wrong). In my application, I have a session area (managed by Spring and put in a backup bean) of a bean named "userDetailsBean".

Is it possible to get all bean instances created for different users in some collection using the JSF API?

+6
source share
1 answer

Add and remove them to / from some collection / display of the entire collection during @PostConstruct and @PreDestroy .

 @PostConstruct public void init() { allSessionScopedBeans.add(this); } @PreDestroy public void destroy() { allSessionScopedBeans.remove(this); } 
+10
source

Source: https://habr.com/ru/post/919052/


All Articles