JSF .xcss стили не отображаются - PullRequest
0 голосов
/ 25 августа 2011

Я использую 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>


Я загружаю этот test.xcss через мой template.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: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 пуст. Любые идеи, почему он не отображает файл правильно?

Я подозреваю, что файлы .xcss не поддерживаются в Richfaces 4, теперь используются файлы 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 Ответ

1 голос
/ 25 августа 2011

Нашел мой ответ:

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

.xcss больше не поддерживается, теперь нужно немного перенести код: (

...