[英]<my:foo> Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents, but no tag was defined for name: foo
I have a composite component named <my:foo>
and I'm building another composite component named <my:bar>
. 我有一个名为<my:foo>
的复合组件,我正在构建另一个名为<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>
的<cc:implementation>
中使用<my:foo>
<my:bar>
,抛出了以下异常:
<my:foo>
Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents , but no tag was defined for name: foo<my:foo>
标记库支持命名空间: http : //java.sun.com/jsf/composite/mycomponents ,但没有为name定义标记:foo
How is this caused and how can I solve it? 这是怎么造成的,我该如何解决?
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. 这是由Mojarra 2.1.8中引入的错误引起的,在2.1.9中继续,并在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: 此错误导致复合组件自己的XML命名空间无法在<ui:component>
/ <ui:composition>
/ <html>
/ etc等根XML元素中声明,如下所示:
<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>
. 当您尝试在<cc:implementation>
嵌套<my:foo>
时,这将导致以下异常。
<my:foo>
Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents , but no tag was defined for name: foo<my:foo>
标记库支持命名空间: http : //java.sun.com/jsf/composite/mycomponents ,但没有为name定义标记:foo
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>
. 除了降级到2.1.7并等待2.1.10发布之外,当前的解决方法是将XML名称空间声明移动到<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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.