2011-10-08 42 views
3

我開發這個聯繫方式:如何阻止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> 

隨着這些樣式,腳本在年底o添加我的部分我的頁腳剛剛消失,我怎麼能解決這個問題?

有什麼想法?

回答

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>