我正在使用 PrimeFaces,我有下一个 jsf 页面:
<h:form id="form1111">
<p:commandLink value="Include Page" actionListener="#{dynaInclBean.includePage}" update="dynInclTabView"/>
<p:tabView id="dynInclTabView" dynamic="true">
<p:tab title="Somename" binding="#{dynaInclBean.tab}"/>
</p:tabView>
</h:form>
我的支持豆:
private Tab tab;
public Tab getTab() {
return tab;
}
public void setTab(Tab tab) {
this.tab = tab;
}
public void includePage() throws IOException
{
FaceletContext faceletContext = (FaceletContext) FacesContext.getCurrentInstance().getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
faceletContext.includeFacelet(tab, "playerPhoto.xhtml");
}
我想将页面包含到选项卡中。当我调用 inlcudePage() 我得到一个异常: org.apache.myfaces.view.facelets.el.ContextAwareELException: javax.el.ELException: java.lang.NullPointerException
我究竟做错了什么?