【问题标题】:Where to put custom RichFaces my.skin.properties file?将自定义 RichFaces my.skin.properties 文件放在哪里?
【发布时间】:2012-03-24 23:25:07
【问题描述】:

文档说把它放在 META-INF/skins 中,但是 RichFaces 没有找到它,或者我尝试过的其他任何地方。

我将 Tomcat 与 MyFaces 2 JSF 和 RichFaces 4 组件一起使用

更新:我将Tomcat抛出的异常发布在http://paste.lisp.org/display/128193

更新 2:针对下面 BalusC 的 cmets,我确定将 org.richfaces.SKIN 指定为大写也无济于事。

【问题讨论】:

    标签: jsf tomcat richfaces


    【解决方案1】:

    community forums 指出 my.skin.properties 文件(注意:将 skin 复数为 skins--如 my.skins.properties--不正确)必须在WEB-INF/classes/META-INF/skins.

    例如,在 NetBeans 中,可以按如下方式完成:

    1. 切换到文件标签。
    2. 在 src 和 web 同级创建一个名为 resources 的新目录。
    3. resources 中创建一个名为WEB-INF 的子目录。
    4. my.skin.properties 复制到resources/WEB-INF
    5. 更新web.xml 以包含:

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

    注意:有些地方,包括正式文档,将皮肤参数名称称为org.richfaces.SKIN,这是不正确的。参数名称必须全部小写。

    下一步:

    1. 更新build.xml 以包含:

      <target name="-post-dist">
        <war destfile="${dist.war}" update="true">
          <zipfileset dir="${basedir}/resources/WEB-INF" prefix="WEB-INF/classes" />
        </war>
      </target>
      
    2. Shift+F11 重新构建应用程序。

    验证存档(例如 Project.war)是否包含以下文件:

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

    部署后,应用程序应找到属性文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-07
      • 2021-07-31
      • 2012-07-11
      相关资源
      最近更新 更多