是否可以禁用 f:event type="preRenderView"回发监听器?
进行回发时是否可以“禁用”触发此操作?
<f:metadata>
<f:event listener="#{defaultNewQuestionHandler.init}" type="preRenderView" />
</f:metadata>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不可能做到这一点。您需要手动检查FacesContext#isPostback()
在侦听器方法内。在即将推出的 JSF 2.2
标记中,该标记应该替换此
“解决方法”,它不过,可以通过onPostback
属性实现:JSF 2.2 的快照版本已经可用。
另请参阅:
That's not possible with
<f:event>
. You need to manually checkFacesContext#isPostback()
inside the listener method.In the upcoming JSF 2.2
<f:viewAction>
tag, which is supposed to replace this<f:event type="preRenderView">
"workaround", it will however be possible with theonPostback
attribute:Snapshot releases of JSF 2.2 are already available.
See also: