【发布时间】:2011-06-18 12:21:09
【问题描述】:
我是 jsf 的新手,我想知道如何在不“复制粘贴”的情况下重复使用其他 .jsf 页面。
在 .jsp 我做:
// head.jsp
<head> ... </head>
// top.jsp
<body> ... </body>
Then i include them in my new .jsp
// index.jsp
<%@include file="head.jsp" %>
<%@include file="top.jsp" %>
...
我怎样才能用 jsf 做到这一点? 我正在尝试这种方式:
<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>
<ui:include src="components/head.xhtml" />
</h:head>
<h:body>
<ui:include src="components/top.xhtml" />
</h:body>
</html>
但不工作..
有什么想法吗?
最好的问候, 瓦尔特·恩里克。
【问题讨论】: