users@javaserverfaces.java.net

RE: Question regarding includes and subviews

From: Jason Lee <lee_at_iecokc.com>
Date: Mon, 5 Mar 2007 16:43:02 -0600

> -----Original Message-----
> 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.

JSP requires that you wrap text in <h:outputText />. I'm guessing you
have something like

        <h:outputLink
value="http://foo">#{myBean.someText}</h:outputLink>

Which should be

        <h:outputLink value="http://foo"><h:outputText
value="#{myBean.someText}"/></h:outputLink>

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

You are using HTML comments (<!-- -->). If you want the JSP compiler to
ignore that markup, use JSP comments (<%-- --%>).

-----
Jason Lee, SCJP
JSF RI Dev Team
Senior Software Engineer
http://www.iec-okc.com