2

如果我在 web.xml 中使用 myskin 而不是 blueSky ,则有两个 css 文件未加载 (skinning.css 和 packed.css) ,我的日志显示:

 1. WARNING JSF1064: Unable to find or serve resource,
    org.richfaces.staticResource/4.2.0.Final/Packed/mysking/skinning.css.
 2. WARNING JSF1064: Unable to find or serve resource,
    org.richfaces.staticResource/4.2.0.Final/Packed/mysking/packed/packed.css.

谁能帮我解决上述问题?

4

1 回答 1

1

您需要“手动”创建这些文件。

我最近写了一篇关于这个的博客文章,看看吧

编辑:在您的情况下,您需要将其添加到 pom.xml

<plugin>
     <groupId>org.richfaces.cdk</groupId>
     <artifactId>maven-richfaces-resources-plugin</artifactId>
     <version>4.2.0.Final</version>
     <configuration>
          <skins>
               <skin>mysking</skin>
          </skins>
          <excludedFiles>
               <exclude>^\Qorg.richfaces.renderkit.html.images.\E.*</exclude>
               <exclude>^\Qorg.richfaces.renderkit.html.iconimages.\E.*</exclude>
          </excludedFiles>
          <includedContentTypes>
               <include>text/css</include>
               <include>image/.+</include>
          </includedContentTypes>
          <fileNameMappings>
                <property>
                     <name>^.*showcase.*/([^/]+\.css)$</name>
                     <value>org.richfaces.showcase.css/$1</value>
                </property>
                <property>
                     <name>^.+/([^/]+\.(png|gif|jpg))$</name>
                     <value>org.richfaces.images/$1</value>
                </property>
                <property>
                     <name>^.+/([^/]+\.css)$</name>
                     <value>org.richfaces.css/$1</value>
                </property>
          </fileNameMappings>
     </configuration>
     <executions>
          <execution>
               <id>process-resources</id>
               <goals>
                    <goal>process</goal>
               </goals>
               <configuration>    
                    <staticResourceMappingFile>${project.build.outputDirectory}/META-INF/richfaces/packed-resource-mappings.properties</staticResourceMappingFile>

                    <resourcesOutputDir>${project.build.outputDirectory}/META-INF/resources/org.richfaces.staticResource/4.2.0.Final/Packed/</resourcesOutputDir>
                    <staticResourcePrefix>org.richfaces.staticResource/4.2.0.Final/Packed</staticResourcePrefix>

                    <pack>true</pack>                            
                    <compress>false</compress>

                    <excludedFiles>
                         <exclude>^javax.faces</exclude>
                         <exclude>^\Qorg.richfaces.renderkit.html.images.\E.*</exclude>
                         <exclude>^\Qorg.richfaces.renderkit.html.iconimages.\E.*</exclude>
                         <exclude>^jquery\.js$</exclude>
                    </excludedFiles>

               </configuration>
          </execution>
     </executions>
</plugin>
于 2013-01-08T10:02:04.353 回答