【问题标题】:How to integrate richfaces 4.3 (a4j) in JSF2 Enterprise Application如何在 JSF2 Enterprise Application 中集成richfaces 4.3 (a4j)
【发布时间】:2013-01-24 07:12:28
【问题描述】:

在尝试将 Richfaces 集成到 JSF2 项目中时,我收到了警告。

Warning: The page /template/template.xhtml declares namespace http://richfaces.org/a4j and uses the tag a4j:region , but no TagLibrary associated to namespace.

我没有使用 maven,所以我手动制作了所有内容。 我做了以下事情来整合它: 将 EAR Deployment Assembly 放入以下 ​​jars:

richfaces-components-api-4.3.0.Final.jar
richfaces-components-ui-4.3.0.Final.jar
richfaces-core-api-4.3.0.Final.jar
richfaces-core-impl-4.3.0.Final.jar
sac-1.3.jar 
guava-11.0.2.jar 
cssparser-0.9.5.jar 

将其添加到 WAR 的清单中。

这是页面片段:

<ui:composition
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:a4j="http://richfaces.org/a4j"
    id="TemplateView">
   ...
    <h:form id="templateForm">
        <a4j:region>
            <a4j:jsFunction name="refreshSession">
                <a4j:actionparam name="refresh" assignTo="#{ilapAdapter.refreshSession}"/>
            </a4j:jsFunction>
        </a4j:region>
    </h:form>
   ...

我错过了什么吗?为什么我会收到此警告?根据“入门”指南,无需在 faces-config.xml 或 web.xml 中进行额外配置。

我只需要 Richfaces 的 Ajax 功能。

PS。将richfaces-core-api-4.3.0.Final.jar、richfaces-core-impl-4.3.0.Final.jar放到WEB-INF.lib中也不起作用。

Richfaces 相关 SystemOut:

[08.02.13 14:18:26:398 CET] 00000022 DefaultFacesC I   Reading config : wsjar:file:/C:/projects/folab/workspace/FOLAB-WAS8/installedApps/CE02110Node02Cell/Dialog_Common_EAR.ear/richfaces-core-impl-4.3.0.Final.jar!/META-INF/faces-config.xml
[08.02.13 14:18:26:949 CET] 00000022 Config        W org.richfaces.application.DefaultModule configure There was no service org.richfaces.focus.FocusManager found
[08.02.13 14:18:26:956 CET] 00000022 Cache         I org.richfaces.cache.CacheManager getCacheFactory Selected fallback cache factory
[08.02.13 14:18:26:959 CET] 00000022 Cache         I org.richfaces.cache.lru.LRUMapCacheFactory createCache Creating LRUMap cache instance using parameters: {com.ibm.ws.jsf.JSP_UPDATE_CHECK=true, javax.faces.STATE_SAVING_METHOD=server, javax.faces.PROJECT_STAGE=Development, com.ibm.ws.jsf.LOAD_FACES_CONFIG_AT_STARTUP=true, javax.faces.CONFIG_FILES=/WEB-INF/faces-navigation.xml, javax.faces.DEFAULT_SUFFIX=.xhtml}
[08.02.13 14:18:26:969 CET] 00000022 Cache         I org.richfaces.cache.lru.LRUMapCacheFactory createCache Creating LRUMap cache instance of 512 items capacity
[08.02.13 14:18:26:985 CET] 00000022 Application   I org.richfaces.application.InitializationListener onStart  by , version 
[08.02.13 14:18:26:989 CET] 00000022 Application   W org.richfaces.application.InitializationListener logWarningWhenConnectionFactoryPresent JMS API was found on the classpath; if you want to enable RichFaces Push JMS integration, set context-param 'org.richfaces.push.jms.enabled' in web.xml

【问题讨论】:

    标签: jsf-2 richfaces


    【解决方案1】:

    尤里卡!

    问题是 myfaces 实现错误。 Richfaces 4.3 至少需要 myfaces 2.1.5 我一直在使用 2.0.8。第一次阅读需求时不知何故错过了这些信息。

    第二个问题是缺少richfaces-components-ui-4.3.0.Final.jar(但是根据自述文件和开发指南,a4j 不需要它)。 希望它对将来的人有所帮助。

    【讨论】:

      猜你喜欢
      • 2012-08-15
      • 2013-08-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-09
      • 2011-02-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多