2013-02-08 73 views
2

我在嘗試將Richfaces集成到JSF2項目中時收到以下警告。如何將richfaces 4.3(a4j)集成到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部署大會下列jar:

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。在WEB-INF.lib中放置richfaces-core-api-4.3.0.Final.jar,richfaces-core-impl-4.3.0.Final.jar也不起作用。

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 

回答

0

尤里卡!

問題是錯誤的myfaces實現。 Richfaces 4.3至少需要myfaces 2.1.5我一直在使用2.0.8。不知何故,我第一次閱讀需求時錯過了這些信息。

第二個問題是缺少richfaces-components-ui-4.3.0.Final.jar(但是根據自述文件和開發指南,它不需要用於a4j)。 希望它可以幫助未來的人。