首页 > 解决方案 > 页面刷新时未调用 JSF init

问题描述

我有 jsf 会话范围的 bean。它的 init 方法带有注释 @PostConstruct 在第一次加载页面时调用,但不是在每次重新加载或刷新时调用。我想在每次页面刷新时调用一些方法。我需要使用 xhtml 文件中的哪些注释或更改

标签: jsf

解决方案


如果您想在每次刷新页面时调用一个方法,最好使用ComponentSystemEvent

您可以参考以下链接 https://www.tutorialspoint.com/jsf/jsf_applicationevents_tag.htm


推荐阅读