我开发了这个联系表格:

<!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"
    xmlns:rich="http://richfaces.org/rich">

    <h:form>

            <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>

我在我的联系页面中导入了这个组合,但我不知道为什么,它把这个脚本放在 <h:head>..</h:head> 部分的末尾:
<script type="text/javascript" src="/Project/javax.faces.resource/jsf.js.xhtml?ln=javax.faces"></script>
<script type="text/javascript" src="/Project/javax.faces.resource/jquery.js.xhtml"></script>
<script type="text/javascript" src="/Project/javax.faces.resource/richfaces.js.xhtml"></script>
<script type="text/javascript" src="/Project/javax.faces.resource/richfaces-queue.js.xhtml"></script>
<script type="text/javascript" src="/Project/javax.faces.resource/richfaces-base-component.js.xhtml"></script>
<script type="text/javascript" src="/Project/javax.faces.resource/status.js.xhtml?ln=org.richfaces"></script>

我已经尝试在我的 web.xml 中使用此参数禁用 Richfaces 样式:
<?xml version="1.0" encoding="UTF-8"?>
<web-app  //.. configs>
    <display-name>Project</display-name>

    <context-param>
        <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <param-name>org.richfaces.skin</param-name>
        <param-value>plain</param-value>
    </context-param>

    <context-param>
        <param-name>org.richfaces.enableControlSkinning</param-name>
        <param-value>false</param-value>
    </context-param>

    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
</web-app>

使用这些样式,在我的部分末尾添加的脚本,我的页脚消失了,我该如何解决?

任何想法 ?

最佳答案

我将这些行添加到 web.xml。这对我有用。

    <context-param>
    <param-name>org.richfaces.skin</param-name>
    <param-value>plain</param-value>
</context-param>
<context-param>
    <param-name>org.richfaces.LoadStyleStrategy</param-name>
    <param-value>None</param-value>
</context-param>
<context-param>
    <param-name>org.richfaces.enableControlSkinning</param-name>
    <param-value>false</param-value>
</context-param>

关于css - 如何阻止 Richfaces 风格?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7697772/

10-10 23:46