views:

346

answers:

2

I just finished the Netbeans introduction to Hibernate tutorial ( http://netbeans.org/kb/docs/web/hibernate-webapp.html#01 ) and I am getting the following error: "This page calls for XML namespace declared with prefix br but no taglibrary exists"

Now, I have seen a similar question somewhere else: http://forums.sun.com/thread.jspa?threadID=5430327 but the answer is not listed there. Or, if it is, then I am clearly missing it -- line one of my index.xhtml file reads "http://www.w3.org/1999/xhtml". It also does not explain why, when I reload localhost:8080, the message disappears.

Here is my index.xhtml file:

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core"&gt;
    <ui:composition template="./template.xhtml">
        <ui:define name="body">
            <h:form>
                <h:commandLink action="#{filmController.previous}" value="Previous #{filmController.pageSize}" rendered="#{filmController.hasPreviousPage}"/>
                <h:commandLink action="#{filmController.next}" value="Next #{filmController.pageSize}" rendered="#{filmController.hasNextPage}"/>
                <h:dataTable value="#{filmController.filmTitles}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Title"/>
                        </f:facet>
                        <h:outputText value="#{item.title}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Description"/>
                        </f:facet>
                        <h:outputText value="#{item.description}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value=" "/>
                        </f:facet>
                        <h:commandLink action="#{filmController.prepareView}" value="View"/>
                    </h:column>
                </h:dataTable>
                <br/>
                </h:form>
            </ui:define>
        </ui:composition>
    </html>
+2  A: 

The problem clearly comes from the <br/> tag, and facelets is trying to interpret it as a JSF/facelets tag with a prefix.

If we follow the standards, this tag should look like this <br /> (with a space before the slash). Try it that way, and if it doesn't work, try removing it.

Bozho
A: 

I tried removing the <br/> tags as well, and tried <br /> , both got rid of the error. However, no useful output occurred. I think there's a solution along the lines of converting it to a composite component -- although I don't know what that really means.

not to hijack the thread, but I asked the same question, I think, on the sun/oracle forum:

JavaServer Faces - NumberGuess guess.xhtml with <ui:composition> root tag

http://forums.sun.com/thread.jspa?threadID=5435748&amp;tstart=0

Thufir