Take the 2-minute tour ×

How can I include a JSP page in a Facelets page?



        <link href="css/bootstrap.css" rel="stylesheet"></link>




      <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>
share|improve this question

2 Answers 2

up vote 2 down vote accepted

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.

See also:

share|improve this answer

Use OmniFaces http://omnifaces.org

You can use it in this way

<o:resourceInclude path="/someJSPpage.jsp" />



share|improve this answer

Your Answer


