views:

305

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

I don't know why my question is shown this way. I pasted my pages above where I sent my question. The half of the code that I pasted was seen above. Why?

Please delete this... All posts below your question are just for answers. If you post something here that doesn't resolve the question above the post will be down-voted. This is not a conventional forum, read the FAQs
victor hugo
I'm new in here so I was confused. I don't know how to delete the answer or the question itself.
@Duygu, there should be a delete button underneath the text of the answer. No need to delete your question, just this "answer" would be served as a comment to your initial question.
James McMahon
+1  A: 

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" %>
James Schek