Html JSF<;用户界面:包括>;包含未在<;中触发preRenderView事件的页面;h:车身>;
我使用的是JSF 2.0.1,在尝试使用Html JSF<;用户界面:包括>;包含未在<;中触发preRenderView事件的页面;h:车身>;,html,jsf,events,jsf-2,prerenderview,Html,Jsf,Events,Jsf 2,Prerenderview,我使用的是JSF 2.0.1,在尝试使用将header.xhtml添加到其他页面时发现了一个差异,下面是代码示例: header.xhtml <h:head> <title>Major</title> </h:head> <h:body> <ui:include src="header.xhtml"></ui:include> <f:view></f:view> &
将header.xhtml
添加到其他页面时发现了一个差异,下面是代码示例:
header.xhtml
<h:head>
<title>Major</title>
</h:head>
<h:body>
<ui:include src="header.xhtml"></ui:include>
<f:view></f:view>
</h:body>
此页面将作为一个组件添加到主页面,它包含用于检查是否允许用户登录该主页面的preRenderView
事件
<h:head>
<title>Header</title>
</h:head>
<f:event type="preRenderView" listener="#{authorize.checkAuthentication}"/>
<h:body></h:body>
有人能帮我解释一下为什么会出现这种差异吗?有没有什么专业的方法来解决这个问题,比如保留首页内容并触发事件?谢谢
注意:我也检查了一下,但不确定我们的情况是否相同
<h:head>
<title>Major</title>
</h:head>
<ui:include src="header.xhtml"></ui:include>
<h:body>
<f:view></f:view>
</h:body>