3

I downloaded and added primefaces-3.0.M1.jar file to my project.
Then, I added this code to my JSP page:

<%@ taglib uri="http://primefaces.prime.com.tr/ui" prefix="p" %>

But it gives the error:

Can not find the tag library descriptor for "http://primefaces.prime.com.tr/ui"

Can anyone guide me how to overcome this problem?

Alba Mendez
  • 4,189
  • 1
  • 35
  • 51
sadia
  • 185
  • 1
  • 5
  • 14

3 Answers3

4

In the primefaces forum there are some comments that Primefaces 2.x and above won't work with JSP. Use Facelets instead.

A facelet page using primefaces looks like this:

    <?xml version='1.0' encoding='UTF-8' ?> 
    <!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:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:p="http://primefaces.prime.com.tr/ui">
      <h:head>
        ... put your header info here
      </h:ead>
      <h:body>
        .. put your content here
      </h:body>
    </html>

There are some more things to pay attention to if you want to switch from jsp to facelets. I think you start reading some tutorials or this related question and answers.

Community
  • 1
  • 1
Matt Handy
  • 29,195
  • 2
  • 84
  • 106
-2

just add primefaces to your project buildpath.

primefaces in project buildpath

Mihriban Minaz
  • 3,005
  • 2
  • 30
  • 51
vc.0
  • 1
  • That is true IF you are already using the correct namespace. In this case the namespace was wrong. – Kukeltje Feb 17 '16 at 11:31
  • i had the same problem with correct namespace. after i've added primefaces into the buildpath i was able to use p: tag library... – vc.0 Feb 17 '16 at 11:33
  • Yes, that is what I said.. IF you already use the right namespace and you get this error, then this is the answer. But that is **not** what the problem in this question is about. So please add a clarification in the answer. And add info about version etc – Kukeltje Feb 17 '16 at 12:38
-2

You could try the following workaround:

<% response.setContentType("application/xhtml+xml"); %>
mattytommo
  • 52,879
  • 15
  • 115
  • 143
  • **Welcome to StackOverflow!** Please, indent every line of code by four spaces. Thanks! – Alba Mendez May 17 '11 at 17:50
  • 1) Doesn't solve the problem at all. 2) MSIE browser doesn't support this content type and will then pop a *Save As* dialogue. – BalusC May 01 '12 at 19:27