2011-08-25 60 views
0

我使用JSF2和RichFaces的4JSF .xcss风格没有得到呈现

我已经添加了以下到我的web.xml:

<mime-mapping> 
    <extension>xcss</extension> 
    <mime-type>text/css</mime-type> 
</mime-mapping> 


我有一个test.xcss文件:

<?xml version="1.0" encoding="UTF-8"?> 
<f:template xmlns:f="http:/jsf.exadel.com/template" 
    xmlns:u="http:/jsf.exadel.com/template/util" 
    xmlns="http://www.w3.org/1999/xhtml" > 
    <f:verbatim><![CDATA[ 

#content a:link[disabled]{ cursor: default;} 

]]> 
</f:verbatim> 

<u:selector name="body"> 
    <u:style name="background-color" skin="generalBackgroundColor" /> 
    <u:style name="font-size" skin="generalSizeFont" /> 
    <u:style name="font-family" skin="generalFamilyFont" /> 
</u:selector> 

</f:template> 


我加载通过我的template.xhtml这test.xcss:

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

    <meta http-equiv="Content-Type" content="text/html" charset="UTF-8" /> 

<f:view contentType="text/html"> 
    <h:head> 
    <title>TEST</title> 

    <h:outputStylesheet library="css" name="test.xcss" /> 
    </h:head> 
    <h:body> 
    </h:body> 
</f:view> 
</html> 


用Firebug查看内容,该test.xcss是空的。任何想法为什么它不正确渲染文件?

我怀疑Richfaces 4不支持.xcss文件,现在使用ecss文件。

http://docs.jboss.org/richfaces/latest_4_0_X/Developer_Guide/en-US/html_single/#sect-Developer_Guide-Skinning_and_theming-What_are_skins

回答