簡體   English   中英

Rich Faces 4.2.2.Final無法使皮膚正常工作

[英]Rich Faces 4.2.2.Final Cannot get skin to work

我是RichFaces的新手。 對於我的應用程序,我無法將皮膚應用於我的數據表組件。 我知道有關於此https://community.jboss.org/thread/161480的現有線程,我遵循了所有配置,但皮膚仍然無法應用。 參見下圖。

在此處輸入圖片說明

我嘗試在線程中提到4.0.0.20101226-M5版本,但仍然無法正常工作。 這是我當前的代碼:

我的pom.xml

 <properties>
     <org.richfaces.bom.version>4.2.2.Final</org.richfaces.bom.version>
     <webflow-version>2.3.1.RELEASE</webflow-version>
     <mojarra-version>2.1.7</mojarra-version>
 </properties>

  <!-- RichFaces -->

  <dependency>
        <groupId>org.richfaces.cdk</groupId>
        <artifactId>annotations</artifactId>
        <scope>provided</scope>
        <version>${org.richfaces.bom.version}</version>         
  </dependency>

  <dependency>
       <groupId>org.richfaces.ui</groupId>
       <artifactId>richfaces-components-ui</artifactId>
  </dependency>

  <dependency>
      <groupId>org.richfaces.core</groupId>
      <artifactId>richfaces-core-impl</artifactId>
  </dependency>

我的web.xml

  <!-- Use JSF view templates saved as *.xhtml, for use with Facelets -->
  <context-param>
      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
      <param-value>.xhtml</param-value>
  </context-param>
  <!-- Enables special Facelets debug output during development -->
  <context-param>
      <param-name>javax.faces.PROJECT_STAGE</param-name>
      <param-value>Development</param-value>
  </context-param>

  <!-- Causes Facelets to refresh templates during development -->
   <context-param>
        <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
        <param-value>1</param-value>
   </context-param>

   <!-- Plugging the "Blue Sky" skin into the project -->
   <context-param>
        <param-name>org.richfaces.skin</param-name>
        <param-value>blueSky</param-value>
   </context-param>

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

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

   <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-    
    class>
   </listener>
    <servlet>
   <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
   <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  <init-param>
  <param-name>contextConfigLocation</param-name>
  <!-- change servlet-context.xml to web-application-config.xml -->
  <param-value><!-- /WEB-INF/spring/web-application-config.xml --></param-value>
   </init-param>
  <load-on-startup>2</load-on-startup>
</servlet>

 <servlet-mapping>
    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    <url-pattern>/spring/*</url-pattern>
 </servlet-mapping>

 <!-- Just here so the JSF implementation can initialize, *not* used at runtime -->
 <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>*.faces</url-pattern>
</servlet-mapping>

<welcome-file-list>
       <welcome-file>index.html</welcome-file>
</welcome-file-list>

我的頁面

<?xml version='1.0' encoding='UTF-8' ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
         xmlns:rich="http://richfaces.org/rich"
         xmlns:a4j="http://richfaces.org/a4j">

<h:head>
     <title>Data Tables</title>
</h:head> 

<h:body>
     <h3>JSF STARTED!</h3>
<rich:panel>

     <rich:dataTable value="#{userBean.users}" var="user" rows="5" >
<rich:column>
     <f:facet name="header">User</f:facet>
     <h:outputText id="name" value="#{user.name}"/>
</rich:column>
<rich:column>
     <f:facet name="header">Email</f:facet>
     <h:outputText id="email" value="#{user.email}"/>
</rich:column>
</rich:dataTable>

</rich:panel>

</h:body>
</ui:composition>

很抱歉,沒有任何建議,不勝感激!

嘗試使用<html>標簽啟動facelet。

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

        <h:body>
         ...
        </h:body>
</html>

看看是否有幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM