This page requires an XML namespace declared with the prefix br, but taglibrary does not exist

I just finished introducing Netbeans to the Hibernate tutorial ( http://netbeans.org/kb/docs/web/hibernate-webapp.html#01 ) and I get the following error: "This page requires an XML namespace declared with a prefix br but taglibrary does not exist "

Now I saw a similar question somewhere else: http://forums.sun.com/thread.jspa?threadID=5430327 but there is no answer there. Or, if it is, then I obviously missed it - a line from one of my index.xhtml file reads “ http://www.w3.org/1999/xhtml ”. It also does not explain why, when I restart 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">
    <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>
+3
source share
2 answers

The problem clearly stems from the tag <br/>, and layouts try 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 this, and if that doesn't work, try deleting it.

+4
source

, Hibernate . , index.xhtml. , , " XML, br, taglibrary"

xhtml browse.xhtml. , . </html> http://www.w3.org/1999/xhtml.

HTML- (, validator.w3.org) .

, , , <html> :

< html xmlns = "http://www.w3.org/1999/xhtml" >

</html> xmlns = "http://www.w3.org/1999/xhtml" < ui: composition > .

+3

Source: https://habr.com/ru/post/1739487/


All Articles