我正在使用Facelet模板技术在我正在处理的JSF 2应用程序中布局我的页面.
在我的header.xhtml中,primefaces要求菜单栏包含在h:form中.
<h:form>
<p:menubar autoSubmenuDisplay="true">
Menu Items here!
</p:menubar>
</h:form>
Run Code Online (Sandbox Code Playgroud)
所以,在我的内容页面中,我将有另一个h:form或更多.
如果我只是将h:form放在我的template.xhtml中,它会起作用吗?
<h:body>
<h:form>
<div id="top">
<ui:insert name="header"><ui:include src="sections/header.xhtml"/></ui:insert>
</div>
<div>
<div id="left">
<ui:insert name="sidebar"><ui:include src="sections/sidebar.xhtml"/></ui:insert>
</div>
<div id="content" class="left_content">
<ui:insert name="content">Content</ui:insert>
</div>
</div>
<div id="bottom">
<ui:insert name="footer"><ui:include src="sections/footer.xhtml"/></ui:insert>
</div>
<h:form>
</h:body>
Run Code Online (Sandbox Code Playgroud)
我实际上正在考虑一个用例,我需要在页面中使用多个h:form.
谢谢