4

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.

Community
  • 1
  • 1
ravi
  • 6,140
  • 18
  • 77
  • 154

2 Answers2

5

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>.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • okkkk BalusC... i have primefaces3.1 downloaded but it is not in /WEB-INF/lib folder. let me deploy my application again... anyway thank you for such a quick reply. – ravi Mar 12 '12 at 20:41
  • Why is that necessary for some JAR to be in lib directory while some can be added as User Library, when using Eclipse?? – Azfar Niaz Jun 13 '13 at 12:52
  • 1
    @Azfar: Only if you didn't properly configure the user library to automatically end up in `/WEB-INF/lib` of deployment. For future questions, please press `Ask Question` button in right top and don't abuse comments of a different question for that. – BalusC Jun 13 '13 at 12:56
-1

Just dowmload the jar from Java2s primefaces jar downloads and then add the jar to libraries folder in your project

  • 2
    Bad, bad, bad suggestion in multiple ways... First it refers to a prehistoric version of PrimeFaces, secondly, one should either use the PrimeFaces repository or maven-central... as a **_TRUSTED SOURCE_** – Kukeltje Sep 07 '18 at 10:52
  • sorry, i am a beginner and i solve my problem like that. i just share my solution as a beginner. thanks for your comment it will help me to answer technically next time – Abderrahmane BECHIKH Sep 07 '18 at 16:51