JSF Primefaces树节点初学者

JSF Primefaces树节点初学者,primefaces,Primefaces,我试着使用primefaces.org上的showcase Tut的例子。我在xhtml文件以及TreeBean.java中复制了完全相同的文本 但使用IE9浏览器中从未出现过树结构。将显示一个空块而不是树。在使用树节点时,有什么需要记住的吗 !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="

我试着使用primefaces.org上的showcase Tut的例子。我在xhtml文件以及TreeBean.java中复制了完全相同的文本

但使用IE9浏览器中从未出现过树结构。将显示一个空块而不是树。在使用树节点时,有什么需要记住的吗

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"      
"http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:p="http://primefaces.org/ui">

<f:view contentType="text/html">
    <h:head>
        <f:facet name="first">
            <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
            <title>PrimeFaces</title>
        </f:facet>
    </h:head>

    <h:body>

        <p:layout fullPage="true">

            <p:layoutUnit position="north" size="100" resizable="true" closable="true" collapsible="true">
                Header
            </p:layoutUnit>

            <p:layoutUnit position="south" size="100" closable="true" collapsible="true">
                Footer
            </p:layoutUnit>

            <p:layoutUnit position="west" size="175" header="Left" collapsible="true">
                <h:form id="form">
                    <p:tree value="#{treeBean.root}" var="node" id="tree">
                        <p:treeNode id="treeNode">
                            <h:outputText value="#{node}" id="lblNode"/>
                        </p:treeNode>
                    </p:tree>
                </h:form> 
            </p:layoutUnit>

            <p:layoutUnit position="center">
                Welcome to PrimeFaces
            </p:layoutUnit>

        </p:layout>

    </h:body>

</f:view>

您还必须创建和复制一个TreeBean类。它适用于primefaces showcase站点上xhtml源代码旁边的每个示例。要使它对EL可见,您必须另外在@Named或@ManagedBean中对其进行注释,并给它一些合理的生命周期范围

//编辑:

@Named
@javax.enterprise.context.SessionScoped
public class TreeBean {  ... }

你能从你的bean中添加代码吗?我已经从这个例子中包含了相同的类。