Problem with PrimeFaces taglib in using JSF
I downloaded and added primefaces-3.0.M1.jar
file to my project.
<%@ taglib uri="http://primefaces.prime.com.tr/ui" prefix="p" %>
But it gives the error:
Can not find the tag library descriptor for "h开发者_开发知识库ttp://primefaces.prime.com.tr/ui"
Can anyone guide me how to overcome this problem?
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.
You could try the following workaround:
<% response.setContentType("application/xhtml+xml"); %>
just add primefaces
to your project buildpath.
精彩评论