Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/320.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
NETBEANS 7.4:“;没有为name:register";定义标记+“;找不到命名空间的库http://java.sun.com/jsf/composite/my_composite_component”_Java_Jsf_Jsf 2_Netbeans_Composite Component - Fatal编程技术网

NETBEANS 7.4:“;没有为name:register";定义标记+“;找不到命名空间的库http://java.sun.com/jsf/composite/my_composite_component”

NETBEANS 7.4:“;没有为name:register";定义标记+“;找不到命名空间的库http://java.sun.com/jsf/composite/my_composite_component”,java,jsf,jsf-2,netbeans,composite-component,Java,Jsf,Jsf 2,Netbeans,Composite Component,我正在Linux Mint 13 Maya上使用Netbeans 7.4。我将学习如何编写一个简单的JSF复合组件。但我有一些错误: 当我尝试启动我的应用程序时: <my_composite_component:register> Tag Library supports namespace: http://java.sun.com/jsf/composite/my_composite_component, but no tag was defined for name: regis

我正在Linux Mint 13 Maya上使用Netbeans 7.4。我将学习如何编写一个简单的JSF复合组件。但我有一些错误:

当我尝试启动我的应用程序时:

<my_composite_component:register> Tag Library supports namespace: http://java.sun.com/jsf/composite/my_composite_component, but no tag was defined for name: register
以下是我的Netbeans项目中的目录结构:

以及守则:

register.xhtml-我的复合组件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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:composite="http://java.sun.com/jsf/composite"
      >

    <composite:interface>

        <composite:attribute name="nameLable" />
        <composite:attribute name="nameValue" />
        <composite:attribute name="emailLable" />
        <composite:attribute name="emailValue" />

        <composite:attribute name="registerButtonText" />
        <composite:attribute name="registerButtonAction" 
                             method-signature="java.lang.String action()" />

    </composite:interface>

    <composite:implementation>

        <h:form>

            <h:message for="textPanel" style="color:red;" />

            <h:panelGrid columns="2" id="textPanel">

                #{cc.attrs.nameLable} : 
                <h:inputText id="name" value="#{cc.attrs.nameValue}" />

                #{cc.attrs.emailLable} : 
                <h:inputText id="email" value="#{cc.attrs.emailValue}" />

            </h:panelGrid>

            <h:commandButton action="#{cc.attrs.registerButtonAction}" 
                             value="#{cc.attrs.registerButtonText}"
                             />

        </h:form>

    </composite:implementation>

</html>

#{cc.attrs.nameLable}:
#{cc.attrs.emailLable}:
index.xhtml我尝试使用我的组件:

“No library found for namespace http://java.sun.com/jsf/composite/my_composite_component”
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:my_composite_component="http://java.sun.com/jsf/composite/my_composite_component"
      >

    <h:body>

        <h1>Composite Components in JSF 2.0</h1>

    <my_composite_component:register 
        nameLable="Name" 
        nameValue="#{user.name}" 
        emailLable="E-mail" 
        emailValue="#{user.email}"

        registerButtonText="Register" 
        registerButtonAction="#{user.registerAction}"
     />

    </h:body>

</html>

JSF2.0中的复合组件

我使用的是jsf 2.2,而不是java.sun.com/jsf,我使用这个名称空间:

xmlns:my_composite_component="http://xmlns.jcp.org/jsf/composite/my_composite_component