Search code examples
jsftomcatrichfaces

Where to put custom RichFaces my.skin.properties file?


The docs say put it in META-INF/skins, but RichFaces doesn't find it there, or anywhere else I tried.

I use Tomcat with MyFaces 2 JSF and RichFaces 4 components

Update: I posted the Exception that Tomcat throws at http://paste.lisp.org/display/128193

Update 2: In response to BalusC's comments below, I established that specifying org.richfaces.SKIN in uppercase also doesn't help.


Solution

  • The community forums notes that the my.skin.properties file (note: pluralizing skin to skins--as in my.skins.properties--is incorrect) must be in WEB-INF/classes/META-INF/skins.

    In NetBeans, for example, this can be accomplished as follows:

    1. Switch to the Files tab.
    2. Create a new directory at the same level as src and web called resources.
    3. Create a sub-directory in resources called WEB-INF.
    4. Copy my.skin.properties into resources/WEB-INF.
    5. Update web.xml to contain:

      <context-param>
          <param-name>org.richfaces.skin</param-name>
          <param-value>my</param-value>
      </context-param>
      

    Note: Some places, including the formal documentation, refer to the skin param-name as org.richfaces.SKIN, which is incorrect. The param-name must be all lowercase.

    Next:

    1. Update build.xml to contain:

      <target name="-post-dist">
        <war destfile="${dist.war}" update="true">
          <zipfileset dir="${basedir}/resources/WEB-INF" prefix="WEB-INF/classes" />
        </war>
      </target>
      
    2. Press Shift+F11 to rebuild the application.

    Verify that the archive (e.g., Project.war) contains the following file:

    \Project.war\WEB-INF.classes\my.skin.properties
    

    When deployed, the application should find the properties file.