Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html JSF<;用户界面:包括>;包含未在<;中触发preRenderView事件的页面;h:车身>;_Html_Jsf_Events_Jsf 2_Prerenderview - Fatal编程技术网

Html JSF<;用户界面:包括>;包含未在<;中触发preRenderView事件的页面;h:车身>;

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> &

我使用的是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>
</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>