【发布时间】:2011-03-29 07:58:36
【问题描述】:
这一定很简单。我正在尝试将子元素传递给 JSF 组件。我的组件声明为:
<?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:composite="http://java.sun.com/jsf/composite">
<composite:interface>
</composite:interface>
<composite:implementation>
<div style="border: 1px solid black;">
<ui:insert />
</div>
</composite:implementation>
</html>
然后我通过以下方式在页面中使用它:
<box:box>
<p>Hello world!</p>
</box:box>
不幸的是,该框呈现正常(黑色边框),但“Hello world!”文本不包含在其中。我还尝试了使用<ui:insert name="content"> 和<ui:define name="content">Hello World!</ui:define> 调用的更详细的语法,但它不起作用。
我可能会在哪里犯错?
【问题讨论】:
标签: java jsf components wrapper parameter-passing