本文介绍了< f:subview>之间的区别和< ui:composition>标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<f:subview><ui:composition>标签之间有什么区别?这些标签分别适合什么目的和情况?

What is the difference between <f:subview> and <ui:composition> tags? For what purposes and cases are each of these tags suiteble for?

推荐答案

<f:subview> 引入了新的 NamingContainer 层,最初(在JSF 1.0中)被设计为与JSP的<jsp:include>标记结合使用.

<f:subview id="foo">
    <jsp:include page="/WEB-INF/include.jsp" />
</f:subview>

在使用Facelets而不是JSP作为默认视图技术的JSF 2.0中,此标记不再具有真正的价值.

In JSF 2.0, which uses Facelets instead of JSP as default view technology, this tag has not really a value anymore.

<ui:composition> (来自JSP的后继Facelets)定义了模板组成,并允许开发人员在诸如Dreamweaver之类的可视HTML编辑器中设计HTML模板.当实际在JSF/Facelets环境中使用时,<ui:composition>之外的任何内容都将被忽略,仅内部内容将用于构建组件树.此标记可在包含页面和模板客户端中使用.另请参见如何使用JSF 2.0 Facelets在XHTML中包含另一个XHTML?

The <ui:composition>, which is from JSP's successor Facelets, definies a template composition and allows the developers to design the HTML template in visual HTML editors like Dreamweaver. When actually used in a JSF/Facelets environment, any content outside <ui:composition> will be disregarded and only the inner content will be used to build the component tree. This tag can be used in both the include pages and template clients. See also How to include another XHTML in XHTML using JSF 2.0 Facelets?

这篇关于&lt; f:subview&gt;之间的区别和&lt; ui:composition&gt;标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 04:36