jsf - 页面刷新时未调用 JSF init
问题描述
我有 jsf 会话范围的 bean。它的 init 方法带有注释 @PostConstruct 在第一次加载页面时调用,但不是在每次重新加载或刷新时调用。我想在每次页面刷新时调用一些方法。我需要使用 xhtml 文件中的哪些注释或更改
解决方案
如果您想在每次刷新页面时调用一个方法,最好使用ComponentSystemEvent。
您可以参考以下链接 https://www.tutorialspoint.com/jsf/jsf_applicationevents_tag.htm
推荐阅读
- r - 通过对应列表重命名数据框中的列
- python - 我需要在 pandas DataFrame 中的特定位置添加特定行
- java - 如何在 CI 服务器中设置不同的 graalvm-home 和 java-home 来构建原生镜像
- amcharts - AmCharts4 删除地图图表中的大陆
- php - Laravel 任务调度没有运行所有命令
- date - 过滤今天之后的日期的宏
- python - 用 cartopy 绘制 Sentinel-3 场景
- ios - 使用组合框架 iOS 刷新令牌机制
- iot - 是否有“不支持浮点 fbos”的解决方法?
- google-geolocation - 为什么 Google geolocation api 无法从 wifi 接入点进行地理定位?