Jsf 如何使richfaces皮肤起作用?

Jsf 如何使richfaces皮肤起作用?,jsf,richfaces,Jsf,Richfaces,我有一个jsf项目,我只使用core和html jsf标记库制作,但是表单的组件看起来很糟糕,所以我现在尝试添加richfaces,这样我就可以添加一个皮肤,我为richfaces添加的JAR有: richfaces-core-api-4.3.4.Final.jar richfaces-core-impl-4.3.4.Final.jar richfaces-components-api-4.3.4.Final.jar richfaces-components-ui-4.3.4.Final.ja

我有一个jsf项目,我只使用core和html jsf标记库制作,但是表单的组件看起来很糟糕,所以我现在尝试添加richfaces,这样我就可以添加一个皮肤,我为richfaces添加的JAR有:

  • richfaces-core-api-4.3.4.Final.jar
  • richfaces-core-impl-4.3.4.Final.jar
  • richfaces-components-api-4.3.4.Final.jar
  • richfaces-components-ui-4.3.4.Final.jar
  • cssparser-0.9.5.jar
  • 番石榴-r09.jar
  • sac-1.3.来源,罐
我的web.xml如下所示

 <servlet>
      <servlet-name>FacesServlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>
 <servlet-mapping>
  <servlet-name>FacesServlet</servlet-name>
  <url-pattern>*.xhtml</url-pattern>
 </servlet-mapping>

 <filter>  
     <!-- Nome que indentifica o filtro pode ser qualquer um -->
    <filter-name>LoginWard</filter-name> 
    <!-- Endereço da classe que herda de javax.servlet.Filter com o nome dos pacotes e sem .java ex: org.otkdrg.NomeDaClasse --> 
    <filter-class>br.com.gbcCalcados.moduloVendas.filter.LoginWard</filter-class>  
</filter> 
<filter-mapping>  
    <filter-name>LoginWard</filter-name>  
    <url-pattern>*.xhtml</url-pattern>  
</filter-mapping>  

<context-param>  
<param-name>org.richfaces.CONTROL_SKINNING</param-name>  
<param-value>enable</param-value>  
</context-param>  

<context-param> 
<param-name>org.richfaces.SKIN</param-name> 
<param-value>classic</param-value> 
</context-param> 

小脸蛋
javax.faces.webapp.FacesServlet
1.
小脸蛋
*.xhtml
登陆
br.com.gbcCalcados.modulevovendas.filter.LoginWard
登陆
*.xhtml
org.richfaces.CONTROL\u蒙皮
使可能
org.richfaces.SKIN
经典
当我运行项目时,仍然没有发生任何事情,一切都一样,甚至没有异常

这是一页

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

    <ui:composition template="/WEB-INF/templates/gbcTemplate.xhtml" 
     xmlns:rich="http://richfaces.org/rich"  
      xmlns:a4j="http://richfaces.org/a4j" >
        <ui:define name="Conteudo">
        <div id="funcFormDiv" align="center">
            <h:form>
            <h:messages/>
                <h:outputLabel for="campoNome" value="Nome Completo:"/><br/>    
                <h:inputText id="campoNome" required="true" value="#{cadastroFuncBean.nomeCompleto}" validatorMessage="O nome completo é composto de um ou mais nomes e não pode conter numeros" requiredMessage="O nome completo é obrigatorio" >
                 <f:validateRegex pattern="\D* \D*"/>
                </h:inputText><br/>

                <h:outputLabel for="campoUsuario" value="Nome de usuário:"/><br/>   
                <h:inputText id="campoUsuario" required="true" value="#{cadastroFuncBean.usuario}" requiredMessage="O nome de usuario é obrigatorio" validatorMessage="O nome de usuário deve conter no minimo 6 e no maximo 15 letras">
                    <f:validateLength minimum="6" maximum="15"/>
                </h:inputText><br/>

                <h:outputLabel for="campoSenha" value="Senha:"/><br/>   
                <h:inputSecret id="campoSenha" required="true" value="#{cadastroFuncBean.senha}" requiredMessage="A senha é obrigatoria" validatorMessage="A senha deve conter no minimo 3 e no maximo 10 letras">
                    <f:validateLength minimum="3" maximum="10"/>
                </h:inputSecret><br/>

                <h:outputLabel for="campoNumContrato" value="Numero do contrato:"/><br/>    
                <h:inputText id="campoNumContrato" required="true" value="#{cadastroFuncBean.numContrato}" requiredMessage="O numero de contrato é obrigatorio" validatorMessage="Numero de contrato invalido">
                    <f:validateRegex pattern="^9\d{5}"/>

                </h:inputText><br/><br/><br/>
                <h:commandButton value="Enviar" action="#{cadastroFuncBean.cadastrar}"  /><input type="reset" value="Resetar" />
                <br/>
                <h:button id="voltar" value="Voltar para Login" outcome="login" />


            </h:form>
        </div>
        </ui:define>
    </ui:composition>
</html>












模板:

<?xml version="1.0" encoding="UTF-8"?>
<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:rich="http://richfaces.org/rich"  
      xmlns:a4j="http://richfaces.org/a4j"  >

<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GBC calçados</title>
<h:outputStylesheet name="arquivo.css" library="css"/>
</h:head>

<h:body>
<div id="LoginInfoTab"><span id="LoginInfo">Usuário Logado:<h:outputText value="#{sessionScope['usuario_logado'] }"  /></span></div>
<div id="TopBanner"><h:graphicImage width="100%" library="images" name="TopBanner.jpg" /></div>

<div id="Menu" >
<h:form>
   <h:link outcome="clientesHome">
    <div class="menuItem">
        <span class="menuItemTexto">Clientes</span>
    </div>
   </h:link>
   <h:link outcome="vendasHome" >
    <div class="menuItem" id="botaoVendas">
        <span class="menuItemTexto">Vendas</span>
    </div>
   </h:link>

</h:form>
</div>

<div id="Content" align="center">
    <ui:insert name ="Conteudo"/>
</div>
<div id="BottomBanner"><h:graphicImage width="100%" library="images" name="BottomBanner.jpg" /></div>




</h:body>
</html>

GBC calçados
Usuário Logado:
客户
旺达斯族

org.richfaces.CONTROL\u SKINNING
是一个RF 3参数,RF 4具有
org.richfaces.enableControlSkinning
,但默认为启用。你的页面看起来像什么?@Makhiel我在问题中添加了一页你的例子对我有用。您的模板中是否有
?如果没有,就没有地方放置CSS文件。@Makhiel我添加了模板也做了这个问题,我不明白应用程序如何知道其中有richfaces,jsf的servlet和以前一样,我是否缺少任何声明来告诉服务器使用richfaces?啊,应该是org.richfaces.skin而不是skin,同样是来自RF 3。这样行吗?