users@javaserverfaces.java.net

Re: Question regarding includes and subviews

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Mon, 05 Mar 2007 14:43:03 -0800

Jon Miller wrote:
> 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.
If I recall, the JSP 2.1 spec states that #{...} statements are illegal
within template text. If you're running in a JSP 2.0 environment or
older, then #{...} will be ignored and should be passed through as is.
So it sounds like the IDE is assuming 2.1, but the runtime is something
else.
>
> 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).
If you want to comment a section of JSP from being interpreted, then you
need to uses <%-- --%>. The <!-- --> style comments will be treated as
template text and passed through to the response.
>
> <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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: users-help_at_javaserverfaces.dev.java.net
>