As far as I know that JSF keeps all the session scoped bean in some kind of Map (correct me if I am wrong.). In my application I have session scoped (managed by Spring and injected into the backing bean) bean named "userDetailsBean".
Is it possible to get all the instances of the bean created for different user in some sort of collection by the help of JSF API?
Add and remove them to/from some applicationwide collection/mapping yourself during @PostConstruct
and @PreDestroy
.
@PostConstruct
public void init() {
allSessionScopedBeans.add(this);
}
@PreDestroy
public void destroy() {
allSessionScopedBeans.remove(this);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With