0

I'm using JSF in NetBeans. All I want to do is to include a page within another page. But whatever I tried, and when I run the main page, I get no error but I can't see my included page in a main page. Why?

My main page is:

<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:webuijsf="http://www.sun.com/webui/webuijsf">

<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
    <webuijsf:page id="page1">
        <webuijsf:html id="html1">
            <webuijsf:head id="head1">
                <webuijsf:link id="link1" url="/css/front.css"/>
                <webuijsf:script id="script1" url="/scripts/front2.js"/>
                <webuijsf:link url="favicon.ico" rel="shortcut icon" type="image/x-icon"/>
            </webuijsf:head>
            <webuijsf:body id="body1" style="-rave-layout: grid">
                <webuijsf:form id="form1">

                        <!-- This is where I include my page -->
                        <f:subview id="nav">
            <jsp:include page="frontsitemenu.jsp" />
                        </f:subview>


              </webuijsf:form>
            </webuijsf:body>
        </webuijsf:html>
    </webuijsf:page>
</f:view>

My included page is:

<f:subview id="frontsitemenu">
    <f:verbatim>
        <p>rrrrrrrrrrrrrrrrrr</p>
    </f:verbatim>
</f:subview>

1 Answer 1

1

I believe your include page, frontsitemenu.jsp, needs to have all of the standard headers as the jsp you include is evaluated and the result is inserted into the result.

Did you View Source on your resulting webpage from your browser?

Try adding this to your frontsitemenu.jsp:

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>   
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.