2011-04-28 92 views
1

RichFaces 4.0皮膚不起作用。系統默認樣式顯示。RichFaces 4.0皮膚將不起作用

下面是一個XHTML文件內容:

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

    <head> 
    <title>RichFaces</title> 
    <h:outputStylesheet name="/panel.ecss"/> 
    </head> 
    <body> 
    <h:form> 
    <rich:panel> 
    <f:facet name="header"> 
    Just some users 
    </f:facet> 
    <rich:dataTable value="#{userBean.users}" var="user"> 
    <h:column> 
    <h:outputText id="name" value="#{user.name}"/> 
    </h:column> 
    <h:column> 
    <h:outputText id="email" value="#{user.email}"/> 
    </h:column> 
    </rich:dataTable> 
    </rich:panel> 
    </h:form> 
    </body> 
</html> 

輸出看起來是這樣的:

output

我的web.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> 
    <display-name>richfacesPrj</display-name> 
    <welcome-file-list> 
    <welcome-file>index.html</welcome-file> 
    <welcome-file>index.htm</welcome-file> 
    <welcome-file>index.jsp</welcome-file> 
    <welcome-file>default.html</welcome-file> 
    <welcome-file>default.htm</welcome-file> 
    <welcome-file>default.jsp</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>/faces/*</url-pattern> 
    </servlet-mapping> 
    <context-param> 
    <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description> 
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name> 
    <param-value>client</param-value> 
    </context-param> 
    <context-param> 
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> 
    <param-value>resources.application</param-value> 
    </context-param> 
    <listener> 
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class> 
    </listener> 
    <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> 
</web-app> 

回答

1

嘗試h:head代替head 。使用h:head您皮膚的css文件將包含在頁面中。