【问题标题】:JSF .xcss styles not getting renderedJSF .xcss 样式未呈现
【发布时间】:2011-08-25 10:17:13
【问题描述】:

我正在使用 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

【问题讨论】:

    标签: jsf-2 richfaces


    【解决方案1】:

    找到我的答案:

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

    .xcss 不再受支持,现在要做很多代码迁移:(

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-14
      • 1970-01-01
      • 1970-01-01
      • 2013-12-04
      • 2014-03-02
      • 2016-11-22
      • 2015-01-20
      相关资源
      最近更新 更多