Use this tag —which
is very similar to JSP's jsp:include — to
encapsulate and reuse content among multiple XHTML
pages. There are three things this tag can include: plain
XHTML, and XHTML pages that have either a
composition tag or a component
tag.
You supply a filename, through
ui:include's src attribute for JSF
to include. That filename is relative to the XHTML file that
was rendered as a result of the last request. So, for
example, if JSF loaded the view login.xhtml,
and that file included
pageDecorations/header.xhtml, and
pageDecorations/header.xhtml included
companyLogo.xhtml, then
companyLogo.xhtml will not be found if it's in
the pageDecorations directory, because
companyLogo.xhtml has to be in the same
directory as login.xhtml.
| Name | Required | Type | Description |
|---|---|---|---|
src | true | javax.el.ValueExpression
(must evaluate to java.lang.String)
|
The filename of an XHTML page to include. The filename is relative to the XHTML page that was originally loaded. When the included file is intended to come from a resource library contract, the value of this attribute must be an absolute path starting with "/". |