警告:页面 /welcome.xhtml 声明了命名空间 http://primefaces.prime.org/ui 但没有与命名空间关联的 TagLibrary
Warning: The page /welcome.xhtml declares namespace http://primefaces.prime.org/ui but no TagLibrary associated to namespace
我正在尝试使用 primefaces 制作一个项目,但我无法让它工作,标签没有被渲染。这是我得到的:
问题:
welcome.xhtml :
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<h:head>
<title>Ejemplo</title>
<link rel="stylesheet" type="text/css" href="css/styles.css"/>
</h:head>
<h:body>
<center>
<h:form>
<div id="header">
<h1><h:outputLabel value="#{login.msg}"/></h1>
</div>
<div id="body">
<p:growl id="messages"/>
<p:menubar>
<p:submenu label="File" icon="ui-icon-document">
<p:submenu label="New" icon="ui-icon-contact">
<p:menuitem value="Project" url="#" />
<p:menuitem value="Other" url="#" />
</p:submenu>
<p:menuitem value="Open" url="#" />
<p:separator />
<p:menuitem value="Quit" url="#" />
</p:submenu>
<p:submenu label="Edit" icon="ui-icon-pencil">
<p:menuitem value="Undo" url="#" icon="ui-icon-arrowreturnthick-1-w" />
<p:menuitem value="Redo" url="#" icon="ui-icon-arrowreturnthick-1-e" />
</p:submenu>
<p:submenu label="Help" icon="ui-icon-help">
<p:menuitem value="Contents" url="#" />
<p:submenu label="Search" icon="ui-icon-search">
<p:submenu label="Text">
<p:menuitem value="Workspace" url="#" />
</p:submenu>
<p:menuitem value="File" url="#" />
</p:submenu>
</p:submenu>
<p:submenu label="Actions" icon="ui-icon-gear">
<p:submenu label="Ajax" icon="ui-icon-refresh">
<p:menuitem value="Save" actionListener="#{menuView.save}" icon="ui-icon-disk" update="messages"/>
<p:menuitem value="Update" actionListener="#{menuView.update}" icon="ui-icon-arrowrefresh-1-w" update="messages"/>
</p:submenu>
<p:submenu label="Non-Ajax" icon="ui-icon-newwin">
<p:menuitem value="Delete" actionListener="#{menuView.delete}" icon="ui-icon-close" update="messages" ajax="false"/>
</p:submenu>
</p:submenu>
<p:menuitem value="Quit" url="http://www.primefaces.org" icon="ui-icon-close" />
<f:facet name="options">
<p:inputText style="margin-right:10px" placeholder="Search"/>
<p:commandButton type="button" value="Logout" icon="ui-icon-extlink" />
</f:facet>
</p:menubar>
</div>
</h:form>
</center>
</h:body>
web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<display-name>JavaServerFaces</display-name>
<!-- Change to "Production" when you are ready to deploy -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!-- Welcome page -->
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
<!-- JSF mapping -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map these files with JSF -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
这是出现的警告:- 警告:页面 /welcome.xhtml 声明命名空间 http://primefaces.prime.org/ui 并使用标记 p:commandButton ,但没有与命名空间相关联的 TagLibrary。请检查命名空间名称,如果正确,可能是您的库 .taglib.xml 在当前类路径中找不到,或者如果您引用的是复合组件库,请检查您的库文件夹是否与命名空间匹配,并且可以由已安装的 ResourceHandler 定位。!
库已正确导入。我在 Tomcat.
中使用 Eclipse
只是为了关闭 post ,@Balus C 帮助解决了问题
xmlns:p="http://primefaces.prime.org/ui"
改为
xmlns:p="primefaces.org/ui";
我正在尝试使用 primefaces 制作一个项目,但我无法让它工作,标签没有被渲染。这是我得到的:
问题:
welcome.xhtml :
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<h:head>
<title>Ejemplo</title>
<link rel="stylesheet" type="text/css" href="css/styles.css"/>
</h:head>
<h:body>
<center>
<h:form>
<div id="header">
<h1><h:outputLabel value="#{login.msg}"/></h1>
</div>
<div id="body">
<p:growl id="messages"/>
<p:menubar>
<p:submenu label="File" icon="ui-icon-document">
<p:submenu label="New" icon="ui-icon-contact">
<p:menuitem value="Project" url="#" />
<p:menuitem value="Other" url="#" />
</p:submenu>
<p:menuitem value="Open" url="#" />
<p:separator />
<p:menuitem value="Quit" url="#" />
</p:submenu>
<p:submenu label="Edit" icon="ui-icon-pencil">
<p:menuitem value="Undo" url="#" icon="ui-icon-arrowreturnthick-1-w" />
<p:menuitem value="Redo" url="#" icon="ui-icon-arrowreturnthick-1-e" />
</p:submenu>
<p:submenu label="Help" icon="ui-icon-help">
<p:menuitem value="Contents" url="#" />
<p:submenu label="Search" icon="ui-icon-search">
<p:submenu label="Text">
<p:menuitem value="Workspace" url="#" />
</p:submenu>
<p:menuitem value="File" url="#" />
</p:submenu>
</p:submenu>
<p:submenu label="Actions" icon="ui-icon-gear">
<p:submenu label="Ajax" icon="ui-icon-refresh">
<p:menuitem value="Save" actionListener="#{menuView.save}" icon="ui-icon-disk" update="messages"/>
<p:menuitem value="Update" actionListener="#{menuView.update}" icon="ui-icon-arrowrefresh-1-w" update="messages"/>
</p:submenu>
<p:submenu label="Non-Ajax" icon="ui-icon-newwin">
<p:menuitem value="Delete" actionListener="#{menuView.delete}" icon="ui-icon-close" update="messages" ajax="false"/>
</p:submenu>
</p:submenu>
<p:menuitem value="Quit" url="http://www.primefaces.org" icon="ui-icon-close" />
<f:facet name="options">
<p:inputText style="margin-right:10px" placeholder="Search"/>
<p:commandButton type="button" value="Logout" icon="ui-icon-extlink" />
</f:facet>
</p:menubar>
</div>
</h:form>
</center>
</h:body>
web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<display-name>JavaServerFaces</display-name>
<!-- Change to "Production" when you are ready to deploy -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!-- Welcome page -->
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
<!-- JSF mapping -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map these files with JSF -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
这是出现的警告:- 警告:页面 /welcome.xhtml 声明命名空间 http://primefaces.prime.org/ui 并使用标记 p:commandButton ,但没有与命名空间相关联的 TagLibrary。请检查命名空间名称,如果正确,可能是您的库 .taglib.xml 在当前类路径中找不到,或者如果您引用的是复合组件库,请检查您的库文件夹是否与命名空间匹配,并且可以由已安装的 ResourceHandler 定位。!
库已正确导入。我在 Tomcat.
中使用 Eclipse只是为了关闭 post ,@Balus C 帮助解决了问题
xmlns:p="http://primefaces.prime.org/ui"
改为
xmlns:p="primefaces.org/ui";