I'm trying to make a project with primefaces but i can't make it work , the tags are not being rendered. Here is what i've got:
Problem :
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>
This is the warning that comes up : - Warning: The page /welcome.xhtml declares namespace http://primefaces.prime.org/ui and uses the tag p:commandButton , but no TagLibrary associated to namespace. Please check the namespace name and if it is correct, it is probably that your library .taglib.xml cannot be found on the current classpath, or if you are referencing a composite component library check your library folder match with the namespace and can be located by the installed ResourceHandler.!
The libs are properly imported. I'm using eclipse with Tomcat.
xmlns:p="http://primefaces.prime.org/ui"
is the right one? I'm at least not seeing that anywhere in PrimeFaces own documentation. – BalusCxmlns:p="http://primefaces.prime.org/ui"
is the right one? Your question namely implies that you didn't believe the error message and thus you should already have taken the effort to verify if that would be the right one. – BalusC