<我的:foo>标签库支持命名空间:http://java.sun.com/jsf/composite/mycomponents,但没有为名称定义标签:foo [英] <my:foo> Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents, but no tag was defined for name: foo

查看:31
本文介绍了<我的:foo>标签库支持命名空间:http://java.sun.com/jsf/composite/mycomponents,但没有为名称定义标签:foo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为 的复合组件,我正在构建另一个名为 的复合组件.但是当我尝试在 中使用 时,抛出以下异常:

I have a composite component named <my:foo> and I'm building another composite component named <my:bar>. But when I attempt to use <my:foo> inside the <cc:implementation> of <my:bar>, the following exception is been thrown:

<my:foo> 标签库支持命名空间:http://java.sun.com/jsf/composite/mycomponents,但没有为名称定义标签:foo

<my:foo> Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents, but no tag was defined for name: foo

这是怎么引起的,我该如何解决?

How is this caused and how can I solve it?

推荐答案

这是由在 Mojarra 2.1.8 中引入、在 2.1.9 中继续并在 2.1.10 中修复的错误引起的.此错误导致无法在根 XML 元素中声明复合组件自己的 XML 命名空间,例如 //<;html>/etc 如下:

This is caused by a bug which was introduced in Mojarra 2.1.8, continued in 2.1.9 and is fixed in 2.1.10. This bug causes that composite component's own XML namespace cannot be declared in a root XML element like <ui:component>/<ui:composition>/<html>/etc as follows:

<ui:component 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:cc="http://java.sun.com/jsf/composite"
    xmlns:my="http://java.sun.com/jsf/composite/mycomponents"
>
    <cc:interface>
        ...
    </cc:interface>
    <cc:implementation>
        <my:foo />
    </cc:implementation>
</ui:component>

当您尝试将 嵌套在 中时,这将导致以下异常.

This would result in the following exception when you attempt to nest <my:foo> inside the <cc:implementation>.

<my:foo> 标签库支持命名空间:http://java.sun.com/jsf/composite/mycomponents,但没有为名称定义标签:foo

<my:foo> Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents, but no tag was defined for name: foo

目前的解决方法,除了降级到 2.1.7 并等待 2.1.10 发布之外,是将 XML 命名空间声明移到 中.

The current workaround, apart from downgrading to 2.1.7 and waiting for 2.1.10 to be released, is to move the XML namespace declaration into the <cc:implementation>.

<ui:component 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:cc="http://java.sun.com/jsf/composite"
>
    <cc:interface>
        ...
    </cc:interface>
    <cc:implementation xmlns:my="http://java.sun.com/jsf/composite/mycomponents">
        <my:foo />
    </cc:implementation>
</ui:component>

另见:

  • Mojarra 问题 2392
  • Mojarra 问题 2437
  • 这篇关于&lt;我的:foo&gt;标签库支持命名空间:http://java.sun.com/jsf/composite/mycomponents,但没有为名称定义标签:foo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆