Search code examples
jsf-2primefaceswebspherexml-namespaces

No TagLibrary associated to PrimeFaces's namespace


I found the similar question here but it doesn't helping me anymore. However i am facing the same problem. While running my application i get the followine error:

Warning: The page /template/common.xhtml declares namespace http://primefaces.org/ui and uses the tag p:panel , but no TagLibrary associated to namespace.

Below is a snippet of my index.xhtml :

<ui:composition template="/template/common.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui">

    <ui:define name="profile">    

And this is how my common.xhtml file looks (not putting the whole content, just namespaces and 1-2 lines) :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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:p="http://primefaces.org/ui">
<h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Welcome to my website</title>
    <h:outputStylesheet library="css" name="default.css" />
</h:head>
<h:body>
    <div id="header" style="margin: auto; width: 80%;">
        <p:panel>

As described by BalusC at here, one must define xmlns="http://www.w3.org/1999/xhtml". I am doing the same. i.e. second line of index.xhtml file is doing the same. but still i am getting error.


Solution

  • The PrimeFaces 3.x JAR file is missing in your webapp's /WEB-INF/lib folder. Download and drop it in there. Or, if you're using PrimeFaces 2.x, then you should be using the following XML namespace instead:

    xmlns:p="http://primefaces.prime.com.tr/ui"
    

    That other question which you're linking to isn't talking about <p:xxx> tags, but about plain HTML tags like <title>, <div> and so on. It's just the coincidence that in case of that other question the <input> is been placed inside a <p:panel>.