Tag for body definiton in composite component

感情迁移 提交于 2019-11-27 08:35:33

问题


I am creating a composite component to use it in my application. I need to define for every composite component its own body. When I used JSP few years ago, I specified custom body in some tag file, for example titlebar.tag and future body was declared by tag below:

    <jsp:doBody />

and I used it in JSP file:

<foo:titlebar>
    <jsp:body>
        something
    </jsp:body>
</foo:titlebar>

now I need to have something similar in JSF composite components between cc:implementation

<cc:implementation> 
    SOME TAG FOR FUTURE BODY DECLARATION
</cc:implementation>

Can you give me an advice please?


回答1:


There the <cc:insertChildren> is for.

<cc:implementation>
    ...
    <cc:insertChildren />
    ...
</cc:implementation>

See also:

  • Java EE 7 tutorial - Chapter 8.5: Composite Components


来源:https://stackoverflow.com/questions/27857816/tag-for-body-definiton-in-composite-component

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!