使用f:subview包含JSF頁面時,被包含的頁面里只能包含有JSF組件,所有非JSF組件元素必須用f:verbatim標簽進行轉換。
f:subview的使用例:

main.jsp:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
<hr>
使用方法1:
<f:subview id="id1">
<h:outputText value="3"></h:outputText>
<f:verbatim><br>World</f:verbatim>
</f:subview>
<hr>
使用方法2:
<f:subview id="id2">
<c:import url="subpage.jsp" />
</f:subview>
<hr>
使用方法3:
<f:subview id="id3">
<%@ include file="subpage.jsp" %>
</f:subview>
<hr>
使用方法4:
<f:subview id="id4">
<jsp:include page="subpage.jsp" />
</f:subview>
</f:view>

subpage.jsp - 子頁面文件
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:verbatim>subpage.</f:verbatim>
<h:outputText value="output component"></h:outputText>
畫面顯示(略)
參考:
Sun JavaServer Faces API Specifications
Sun JavaServer Faces Tag Library Documentation