如何停止丰富的风格?

时间:2011-10-08 15:24:30

标签: css jsf jsf-2 richfaces

我开发此联系表格:

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

使用这些样式,在我的部分末尾添加的脚本我的页脚消失了,我该怎么办?

有什么想法吗?

1 个答案:

答案 0 :(得分:5)

我将这些行添加到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>