Updated Answer:
Access your application scoped bean from filter in the follwoing way
ServletContext context = req.getServletContext();
MyAppBean myAppBean = (MyAppBean) context.getAttribute("myAppBean");
Access your session scoped bean from filter in the following way
HttpSession session = ((HttpServletRequest) req).getSession(false);
MyAppBean myAppBean = (MyAppBean ) session.getAttribute("myAppBean");
Original Answer :
Yes you can , make it (eager = true)
, and add the needed annotations
@ManagedBean(eager = true)
@ApplicationScoped
public class MyAppBean { }
and in your sesion scoped bean access it like this
@ManagedProperty(value = "#{myAppBean }")
private MyAppBean myAppBean; //add getter and setter
If your bean is not a @ManagedBean
you can access it from the ApplicationMap
like this
MyAppBean myAppBean = (MyAppBean ) FacesContext.getCurrentInstance().
getExternalContext().getApplicationMap().get("country");
If the bean you want to access is a @SessionScoped
you can grab it from the SessionMap
like this
MyAppBean myAppBean = (MyAppBean ) FacesContext.getCurrentInstance().
getExternalContext().getSessionMap().get("country");
Here you got some nice tutorial on how to access beans from a non managed beans
Access A Managed Bean From Event Listener – JSF