How can I include a JSP page in a Facelets page?
mypage.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<meta charset="utf-8"></meta>
<link href="css/bootstrap.css" rel="stylesheet"></link>
</h:head>
<h:body>
</h:body>
</html>
header.jsp
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<div class="nav-collapse collapse">
<ul class="nav">
<li><a href="index.xhtml">Home</a></li>
<li><a href="login.xhtml">Login</a></li>
</ul>
</div>
</div>
</div>
</div>
Facelets has no builtin support for including JSP files. JSP is a deprecated view technology and Facelets is basically its successor. As JSP is deprecated, you shouldn't expect that there are any plans for its support.
Just rename header.jsp
to header.xhtml
and eliminate any JSP specific artifacts. There's nothing in JSP which would be "impossible" with JSF/Facelets.
As a temporary resort, you could use OmniFaces <o:resourceInclude>
tag to embed the output of a JSP/Servlet page in Facelets. Note that it's thus like how <c:import>
works and that it would only work with static content.