为什么联系表单会让我的页脚消失?

发布于 2024-12-09 18:29:03 字数 2353 浏览 0 评论 0原文

我构建了这个联系表单,如果我单独运行它,效果会很好,但是如果我放在联系页面上,会使我的页脚消失,​​我真的不知道为什么会发生这种情况,我真的需要帮助。

contact.xhtml

<!DOCTYPE html>
<ui:composition
    xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:a4j="http://richfaces.org/a4j">

    <h:form id="contact">
            <h:panelGrid columns="3">
            <h:outputLabel for="name" value="Nome (Obrigatório)" />
            <h:inputText id="name" value="#{contact.client.name}" />
            <h:message for="name" />

            <h:outputLabel for="email" value="E-Mail (Obrigatório)" />
            <h:inputText id="email" value="#{contact.client.email}" />
            <h:message for="email" />

            <h:outputLabel for="website" value="Website (Opcional)" />
            <h:inputText id="website" value="#{contact.client.website}" />
            <h:message for="website" />

            </h:panelGrid>

            <h:outputLabel for="text" value="Mensagem (Obrigatório):" /> <br/>
            <h:inputTextarea id="text" value="#{contact.client.text}" rows="20" cols="80" /><br/>
            <h:message for="text" />
            <br/>

            <h:commandButton value="Enviar" action="#{contact.sendMessage}"  >
                    <f:ajax execute="@form" render="@form" />
            </h:commandButton>

            <h:outputText value="#{contact.messageStatus}" id="out"  />

            <a4j:status>
                <f:facet name="start">
                    <h:graphicImage name="loader.gif" library="image" />
                    <h:outputText value="Enviando ..." />
                </f:facet>
            </a4j:status>
    </h:form>
</ui:composition>

如果没有组件“contact.xhtml”,它看起来像: without the component

使用组件(并且没有页脚): 在此处输入图像描述

知道为什么会发生这种情况吗? 有什么帮助吗?

更新 我在这里托管页面,大家可以看一下。

I build this contact form, which works perfectly if I run it alone, but if I put on my contact page make my footer disappear, I really don't know why this is happening, I really need help with this.

contact.xhtml

<!DOCTYPE html>
<ui:composition
    xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:a4j="http://richfaces.org/a4j">

    <h:form id="contact">
            <h:panelGrid columns="3">
            <h:outputLabel for="name" value="Nome (Obrigatório)" />
            <h:inputText id="name" value="#{contact.client.name}" />
            <h:message for="name" />

            <h:outputLabel for="email" value="E-Mail (Obrigatório)" />
            <h:inputText id="email" value="#{contact.client.email}" />
            <h:message for="email" />

            <h:outputLabel for="website" value="Website (Opcional)" />
            <h:inputText id="website" value="#{contact.client.website}" />
            <h:message for="website" />

            </h:panelGrid>

            <h:outputLabel for="text" value="Mensagem (Obrigatório):" /> <br/>
            <h:inputTextarea id="text" value="#{contact.client.text}" rows="20" cols="80" /><br/>
            <h:message for="text" />
            <br/>

            <h:commandButton value="Enviar" action="#{contact.sendMessage}"  >
                    <f:ajax execute="@form" render="@form" />
            </h:commandButton>

            <h:outputText value="#{contact.messageStatus}" id="out"  />

            <a4j:status>
                <f:facet name="start">
                    <h:graphicImage name="loader.gif" library="image" />
                    <h:outputText value="Enviando ..." />
                </f:facet>
            </a4j:status>
    </h:form>
</ui:composition>

Without the componet 'contact.xhtml' it looks like:
without the component

With the component (and without the footer):
enter image description here

Any idea why this is happening ?
Any help ?

UPDATE
I host the page here guys, so you could take a look at it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

享受孤独 2024-12-16 18:29:03

我检查了页面的 HTML 源代码(在浏览器中右键单击页面,查看源代码),在底部我看到未解析的 JSF 标记:

        <a4j:status>
        </a4j:status>

然后所有 HTML 都停在那里。

显然您忘记声明 a4j 的 XML 命名空间,HTML 渲染器生气了。

xmlns:a4j="http://richfaces.org/a4j"

然而这本应在开发阶段发出明确的警告。将以下上下文参数添加到您的 web.xml 中,以便更快地收到有关此类未来错误的通知:

<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

I checked the HTML source of your page (rightclick page in browser, View Source), at the bottom I see unparsed JSF tags:

        <a4j:status>
        </a4j:status>

and then all the HTML stops there.

Apparently you forgot to declare the XML namespace for a4j and the HTML renderer got mad.

xmlns:a4j="http://richfaces.org/a4j"

This should in development stage however have issued a clear warning. Add the following context parameter to your web.xml to be notified sooner on this kind of future mistakes:

<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>
旧城烟雨 2024-12-16 18:29:03

由于没有代码可看,我只能猜测:表单或页脚的边距。

Since there is no code to look at, I can only guess: margins of the form or the footer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文