users@javaserverfaces.java.net

Question regarding includes and subviews

From: Jon Miller <jemiller_at_uchicago.edu>
Date: Mon, 5 Mar 2007 16:40:05 -0600

Hi all,

I'm guessing I'm probably doing something stupid here. I'm including the
following file using the following include directive. NetBeans is giving me
an error message of "#{...} not allowed in template text body." It does this
in the editor, but, it runs fine anyway. What I'm wondering is, am I doing
something wrong, or, is this just an erroneous error message? I'm using JSP
XML documents.

A second problem is that I have the h:dataTable commented out, yet, JSF is
still rendering it even though it's commented. I'm using JSF 1.1 since that
is all NetBeans supports at the moment (at least for use with the version of
Tomcat that comes with it).

<jsp:directive.include file="/WEB-INF/jspf/menu.jspf"/>

<!-- menu.jspf -->

<f:subview id="menu">
    <h:panelGrid>
        <h:commandLink action="#{appointmentsHandler.listAppointments}"
                       value="List appointments" immediate="true"/>
        <h:commandLink rendered="#{appointmentsHandler.student == true}"
                       action="#{appointmentsHandler.editInstructor}"
                       value="New appointment"/>
        <!--<h:dataTable id="instructors"
                     value="#{appointmentsHandler.course.instructors}"
                     var="i">
            <h:column>
                <h:commandLink value="New appointment with #{i.name}"
                               action="#{appointmentsHandler.editAppointment}"
                               immediate="true"/>
            </h:column>
        </h:dataTable>-->
        <h:commandLink rendered="#{appointmentsHandler.instructor == true ||
appointmentsHandler.assistant == true}"
                       action="#{appointmentsHandler.listOfficeHours}"
                       value="List office hours" immediate="true"/>
        <h:commandLink rendered="#{appointmentsHandler.instructor == true ||
appointmentsHandler.assistant == true}"
                       action="#{appointmentsHandler.newOfficeHours}"
                       value="New office hours" immediate="true"/>
    </h:panelGrid>
</f:subview>

Jon