JSF .xcss样式无法呈现

时间:2011-08-25 10:17:13

标签: jsf-2 richfaces

我正在使用JSF2和Richfaces 4。

我已将以下内容添加到我的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

1 个答案:

答案 0 :(得分:1)

找到我的答案:

http://community.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration-Skinning

.xcss不再受支持了,现在要进行相当多的代码迁移:(

相关问题