【发布时间】:2011-08-04 12:49:50
【问题描述】:
这是JSF 2.0 Facelets nested templates inheritance的扩展转贴,被粗略地询问并正式回答。
这是我的 easy_to_earn 问题:
template_base.xhml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head><!-- header stuff --></h:head>
<h:body>
<!-- Lot of html here -->
<div id="main">
<ui:insert name="main_content"/>
</div>
<!-- Lot of html here -->
</h:body>
</html>
接下来,我想要另一个模板,form_wrapped.xhtml,它将扩展 base_template.xhml,但main_content 被@987654324 包裹@:
<div id="main">
<h:form>
<!-- "main_content" goes here -->
</h:form>
</div>
还有页面本身:
<ui:composition template="/WEB-INF/templates/form_wrapped.xhtml">
<ui:define name="main_content">
<!-- this html is wrapped by form -->
</ui:define>
</ui:composition>
我该怎么做?
【问题讨论】: