Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以Bean从FacesContext. 这包括 bean 可能是会话范围的。
Bean
FacesContext
还是我必须在某个地方注册它们并在以后再次检索它们?
我想从其中定义此功能的方法将由 a 触发,@Schedule并且用于清除应用程序中某处保存的所有缓存
@Schedule
提前致谢 :)
是的,你必须。
@PostConstruct public void init() { allBeans.add(this); } @PreDestroy public void destroy() { allBeans.remove(this); }
allBeans可以是注入的应用程序范围 bean。
allBeans