【问题标题】:Enabling ICEfaces compat leads to not recognizing h:head and h:body启用 ICEfaces compat 会导致无法识别 h:head 和 h:body
【发布时间】:2012-04-12 12:15:51
【问题描述】:

我正在开发一个 ICEfaces 3 应用程序,我有以下 XHTML 文件:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
    xmlns:icecore="http://www.icefaces.org/icefaces/core"
    xmlns:ace="http://www.icefaces.org/icefaces/components"
    >
<h:head></h:head>
<h:body>
    <ui:composition template="template/main-template.xhtml"> ... </ui:composition>
</h:body>
</html>

使用这个没有包含在 WAR 中的 icefaces-compat 的模板效果很好(只要我显然只使用 ACE 组件)。但是现在我喜欢使用一些冰:组件,因此需要-compat JAR。但是当将此 JAR 添加到 WAR 时,会发生以下错误:

12.04.2012 13:56:32 org.icefaces.impl.event.BridgeSetup isListenerForSource
WARNING: ICEfaces configured for view /configuration.xhtml but h:head and h:body components are required

当我从侧面完全删除ui:composition标签时也会出现此错误,即&lt;h:body&gt;标签为空。

我很乐意提供更多信息,但现在我不确定什么是重要的,因为我所做的唯一区别是将 -compat 库添加到 WAR。

【问题讨论】:

    标签: icefaces


    【解决方案1】:

    我终于想出了一个非常简单的解决方案:我忘了添加 WEB-INF/faces-config.xml 文件。只要使用 ACE 等,这似乎就可以了,但是一旦使用了 -compat jar,这似乎是必要的。文件本身只需包含:

    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                                  http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
              version="2.0">
    </faces-config>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-05
      • 1970-01-01
      • 1970-01-01
      • 2021-12-07
      • 2018-02-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多