In my attempts to find out the reason for the problems stated in this question: JSF2 slow page loading, I would like to time a user session filter I use. I’ve created a timer that is an ApplicationScoped bean.
My question is if it’s possible to access this bean as a managed property from the filter. In my other beans I can do this, although in the filter the managed property is always null.
Updated Answer:
Access your application scoped bean from filter in the follwoing way
Access your session scoped bean from filter in the following way
Original Answer :
Yes you can , make it
(eager = true), and add the needed annotationsand in your sesion scoped bean access it like this
If your bean is not a
@ManagedBeanyou can access it from theApplicationMaplike thisIf the bean you want to access is a
@SessionScopedyou can grab it from theSessionMaplike thisHere you got some nice tutorial on how to access beans from a non managed beans
Access A Managed Bean From Event Listener – JSF