2012-08-13 65 views
-1

林新的RichFaces。对于我的应用程序,我不能将皮肤应用到我的数据表组件。我知道有关于这个https://community.jboss.org/thread/161480的现有线程,我遵循所有的配置,但皮肤仍然不会应用。见下图。丰富的脸4.2.2.Final无法让皮肤工作

enter image description here

我试过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> 

对不起,文字的墙上,但任何意见给定将不胜感激!

+0

如果您在Web开发人员的角度描述什么是最终失败,而不是从最终用户的角度来看,它会更有帮助。或者,你是否对网络开发一般也是全新的? (即你根本不熟悉基本的HTTP和HTML?)首先,查看JSF生成的HTML源代码,并检查CSS引用是否正确,然后在Chrome/IE9/Firebug中按F12并检查HTTP通信是否全部对。 – BalusC 2012-08-13 15:11:28

+0

我知道http和html的基础,但是对于Spring MVC和RichFaces,我第一次尝试。我遵循你的建议,并设法找出错误“无法获得skinning.ecss” – user1015935 2012-08-14 07:26:13

回答

4

尝试用<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> 

看看是否有帮助。