当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Unable to find skinning.css and packed.css when using custom skin.properties file in richfaces

问题描述:

If I use myskin instead of blueSky in my web.xml there are two css files are not loaded, (skinning.css and packed.css) , my log says:

 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.

Can anyone help me to solve above problem?

网友答案:

You need to create those files "manually".

I have recently written a blog post about this, check it out.

EDIT: In your case you need to add this to 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>
分享给朋友:
您可能感兴趣的文章:
随机阅读: