tags:

views:

193

answers:

2

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"&gt;

<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>

Can someone please help me? Thanks

A: 

hello!

I suggest you use:

<%@include file="_frontsitemenu.jsp" %>

Thats whats working for me

ChrisAD
A: 

You should have ony one f:subview per include. Now you've two, a <f:subview id="nav"> which wraps the jsp:include and a <f:subview id="frontsitemenu"> inside the include page itself. The normal practice is that they're placed in the include file only. So, remove the <f:subview id="nav"> from the parent page.

BalusC