Jsf javax人脸搜索解决方案

Jsf javax人脸搜索解决方案,jsf,jsf-2,primefaces,Jsf,Jsf 2,Primefaces,每次发生错误时,我都会在错误页面中收到以下错误消息 这是my page.xhtml: <!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" x

每次发生错误时,我都会在错误页面中收到以下错误消息

这是my page.xhtml:

<!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 http-equiv="X-UA-Compatible" content="EmulateIE8" />
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>Esprit4Olap</title>
            </f:facet>

            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/default.css" />
            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/syntaxhighlighter/syntaxhighlighter.css" />

            <style type="text/css">
                .nestedUnit {
                    border:0px none !important;
                }

                .ui-layout-center .ui-layout-resizer {
                    border:1px solid #A8A8A8 !important;
                }

                .ui-tree-item span {
                    float:left !important;
                }

                .ui-tree {
                    border:0px none !important;
                }

                .ui-tabs {
                    border:0px none !important;
                }
            </style>
        </h:head>

        <h:body>

                <p:layoutUnit position="west" size="200" resizable="true" collapsible="true" header="TreeNode">
                    <h:form>
                        <p:tree value="#{SchemaMan.shemaBoxses}" var="SchemaMan" selectionMode="Singel" selection="#{SchemaMan.shemaBoxse}" style="width:170px">
                            <p:treeNode icon="ui-icon-mail-closed">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="i" icon="ui-icon-mail-closed">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="s" icon="ui-icon-transfer-e-w">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="t" icon="ui-icon-trash">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="j" icon="ui-icon-alert">
                               <h:outputText value="SchemaMan"/>
                            </p:treeNode>
                        </p:tree>
                    </h:form>
                </p:layoutUnit>

                <p:layoutUnit position="center">

                    <p:layout>

                        <p:layoutUnit position="north" size="50%" resizable="true" styleClass="nestedUnit">

                            <p:tabView>

                                <p:tab title="Schema">

                                    <h:form>

                                        <p:panelGrid columns="2">

                                        <p:inputText id="Schemaname" required="true"    label="SchemaName" size="40" value="#{SchemaMan.nameSchema}" />

                                        <p:inputText id="DescSchema" required="true"    label="DescSchema" size="40" value="#{SchemaMan.descSchema}" />

                                       <p:inputText id="RoleSchema" required="true"     label="RoleSchema" size="40" value="#{SchemaMan.roleSchema}" />

                                       <p:inputText id="CaptionSchema" required="true"  label="CaptionSchema" size="40" value="#{SchemaMan.captionSchema}" />      
                                        </p:panelGrid>
                                          <p:commandButton value="Add" type="button" ></p:commandButton>

                                    </h:form>

                                </p:tab>

                            </p:tabView>

                        </p:layoutUnit> 
                    </p:layout>

                </p:layoutUnit>
            </h:body>
</f:view>
</html>
感谢您的帮助

谢谢

我照你说的做:

 <h:body>


<p:layout>
                <p:layoutUnit position="west" size="200" resizable="true" collapsible="true" header="TreeNode">
                    <h:form>
                        <p:tree value="#{SchemaMan.shemaBoxses}" var="SchemaMan" selectionMode="Singel" selection="#{SchemaMan.shemaBoxse}" style="width:170px">
                            <p:treeNode icon="ui-icon-mail-closed">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="i" icon="ui-icon-mail-closed">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="s" icon="ui-icon-transfer-e-w">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="t" icon="ui-icon-trash">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="j" icon="ui-icon-alert">
                               <h:outputText value="SchemaMan"/>
                            </p:treeNode>
                        </p:tree>
                    </h:form>
                </p:layoutUnit>
                </p:layout>
 <p:layout>
                <p:layoutUnit position="center">



                        <p:layoutUnit position="north" size="50%" resizable="true" styleClass="nestedUnit">

                            <p:tabView>

                                <p:tab title="Schema">

                                    <h:form>

                                        <p:panelGrid columns="2">

                                        <p:inputText id="Schemaname" required="true"    label="SchemaName" size="40" value="#{SchemaMan.nameSchema}" />

                                        <p:inputText id="DescSchema" required="true"    label="DescSchema" size="40" value="#{SchemaMan.descSchema}" />

                                       <p:inputText id="RoleSchema" required="true"     label="RoleSchema" size="40" value="#{SchemaMan.roleSchema}" />

                                       <p:inputText id="CaptionSchema" required="true"  label="CaptionSchema" size="40" value="#{SchemaMan.captionSchema}" />





                                        </p:panelGrid>
                                          <p:commandButton value="Add" type="button" ></p:commandButton>

                                    </h:form>

                                </p:tab>

                            </p:tabView>

                        </p:layoutUnit>





                </p:layoutUnit>
    </p:layout>

            </h:body>


但我现在有一个例外: 例外情况

javax.servlet.ServletException:JBAS011048:无法构造组件实例
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)

您有两个
p:layout
?每个
p:layoutUnit
都应该在一个整体中
p:layout
。考虑到您可以将
p:layout
嵌套在
p:layoutUnit
中以制作更复杂的布局(当然,每个
p:layout
都有一个
p:layoutUnit position=“center”


...
...
...
...

请记住,如果您对整个页面使用p:layout,则最好使用
p:layout fullPage=“true”
.Cheers!

p:layoutUnit
必须嵌套在
p:layout
中,您有两个布局单元:西部和中部。将它们包括在
p:layout
中,但我现在遇到了这个异常:异常javax.servlet.ServletException:JBAS011048:无法构造组件实例javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)!!
 <h:body>


<p:layout>
                <p:layoutUnit position="west" size="200" resizable="true" collapsible="true" header="TreeNode">
                    <h:form>
                        <p:tree value="#{SchemaMan.shemaBoxses}" var="SchemaMan" selectionMode="Singel" selection="#{SchemaMan.shemaBoxse}" style="width:170px">
                            <p:treeNode icon="ui-icon-mail-closed">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="i" icon="ui-icon-mail-closed">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="s" icon="ui-icon-transfer-e-w">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="t" icon="ui-icon-trash">
                                <h:outputText value="SchemaMan"/>
                            </p:treeNode>

                            <p:treeNode type="j" icon="ui-icon-alert">
                               <h:outputText value="SchemaMan"/>
                            </p:treeNode>
                        </p:tree>
                    </h:form>
                </p:layoutUnit>
                </p:layout>
 <p:layout>
                <p:layoutUnit position="center">



                        <p:layoutUnit position="north" size="50%" resizable="true" styleClass="nestedUnit">

                            <p:tabView>

                                <p:tab title="Schema">

                                    <h:form>

                                        <p:panelGrid columns="2">

                                        <p:inputText id="Schemaname" required="true"    label="SchemaName" size="40" value="#{SchemaMan.nameSchema}" />

                                        <p:inputText id="DescSchema" required="true"    label="DescSchema" size="40" value="#{SchemaMan.descSchema}" />

                                       <p:inputText id="RoleSchema" required="true"     label="RoleSchema" size="40" value="#{SchemaMan.roleSchema}" />

                                       <p:inputText id="CaptionSchema" required="true"  label="CaptionSchema" size="40" value="#{SchemaMan.captionSchema}" />





                                        </p:panelGrid>
                                          <p:commandButton value="Add" type="button" ></p:commandButton>

                                    </h:form>

                                </p:tab>

                            </p:tabView>

                        </p:layoutUnit>





                </p:layoutUnit>
    </p:layout>

            </h:body>
<p:layout>
   <p:layoutUnit position="west" size="200">
     ...
   </p:layoutUnit>
   <p:layoutUnit position="center">
     <p:layout>
       <p:layoutUnit position="north" size="100">
         ...
       </p:layoutUnit>
       <p:layoutUnit position="center">
         ...
       </p:layoutUnit>
     </p:layout>
   </p:layoutUnit>
  ...
</p:layout>