更新时间:2022-06-24 18:48:33
XML名称空间网址不正确.像这样声明一个名称空间:
The XML namespace url is incorrect. Declaring a namespace like so:
xmlns:composite="http://java.sun.com/jsf/composite"
将产生复合组件名称空间,例如<composite:interface>
.
Will result in composite component namespace like <composite:interface>
for example.
复合组件应位于WEB-INF/resources/[foldername]
文件夹中,其中[foldername]
是要保留复合组件的文件夹的名称.
Composite components should be in the WEB-INF/resources/[foldername]
folder where [foldername]
is the name of the folder you wish to keep composite components.
然后,您可以使用以下URL引用该文件夹中的复合组件,并提供您选择的给定名称空间.对于此示例,假设我在以下文件夹WEB-INF\resources\ptc
中有一个名为avatarGenerator.xhtml
的复合组件.
You can then reference your composite components in that folder with the following url and providing a given namespace of your choice. For this example lets say I have a composite component called avatarGenerator.xhtml
inside of the following folder, WEB-INF\resources\ptc
.
XML命名空间声明
xmlns:ptc="http://java.sun.com/jsf/composite/ptc"
使用avatarGenerator
<ptc:avatarGenerator attributeone="" attributetwo="">