Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.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
Jsf 两个h:form创建问题以显示h:messages_Jsf_Jsf 2 - Fatal编程技术网

Jsf 两个h:form创建问题以显示h:messages

Jsf 两个h:form创建问题以显示h:messages,jsf,jsf-2,Jsf,Jsf 2,我在我的页面中使用了Richfaces弹出窗口,下面添加了相应的代码。演示代码只有两个文本框和按钮: <?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

我在我的页面中使用了Richfaces弹出窗口,下面添加了相应的代码。演示代码只有两个文本框和按钮:

<?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:ui="http://java.sun.com/jsf/facelets"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions">

<f:metadata>
    <f:event listener="#{loginBean.verifyLogged}" type="preRenderView" />
    <f:event listener="#{cfsBean.fetchAllRFSList}" type="preRenderView" />
</f:metadata>

<h:body>

    <ui:composition template="../templates/home-template.xhtml">
        <ui:define name="content">
            <ui:include src="CfsGroupFeature-Add.xhtml">
                <ui:param name="parentBean" value="#{cfsBean}" />
            </ui:include>
            <h:form id="viewCfs">
                <rich:panel
                    style="border-width: 1px; border-color: #6B489D; padding:30px;width:145%; ">
                    <h:messages style="color:red;margin:8px;" />

                    <br />

                    <h:panelGrid columns="3">

        Enter your username :

        <h:inputText id="username" value="" size="20" required="true"
                            label="UserName">
                            <f:validateLength minimum="5" maximum="10" />
                        </h:inputText>

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

        Enter your age :
        <h:inputText id="age" value="" size="20" required="true" label="Age">
                            <f:validateLongRange for="age" minimum="1" maximum="200" />
                        </h:inputText>

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

                    </h:panelGrid>

                    <h:commandButton value="Submit" action="result" />

                </rich:panel>
            </h:form>
        </ui:define>
    </ui:composition>
</h:body>
</html>

对于一个代码转储完全不是MCVE格式的问题,在5个视图内进行2次向上投票?所以没有人可以通过复制粘贴运行来重现你的问题这里发生了什么?请添加你的弹出窗口代码,可能任何人都可以帮助你,说明代码是这样的:在第一句话中也没有帮助。。。这立刻把我吓跑了,因为我不确定发布的代码是否是实际使用的代码。@Kukeltje不要害怕stackoverflow中的新手,这可能是我的错误,但为什么你害怕?即使你是stackoverflow中的新手,您是一名开发人员,如果您在校对自己的问题时像一名开发人员一样思考,那么在阅读类似这样的代码时,您不会有奇怪的感觉吗?也许我不应该用“吓跑我”,而应该用“赶走我”或“让我停止阅读问题”。结果是一样的:我没有试图给予帮助。。。
<?xml version='1.0' encoding='UTF-8' ?>
<ui:composition 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:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions">


    <ui:define name="title">Page title</ui:define>



     <h:form>/** Some Components**/</h:form>

</ui:composition>