Hello, We’ve seen how to create a hello world application in JSF2 with eclipse. Now, with its reference, we will configure primefaces with eclipse. Create the dynamic web project named PrimeFacesExamples
Well, there is nothing new to configure primefaces with eclipse. In the link mentioned above, our web application is configured with JSF using eclipse. Primefaces is built on JSF and it simply requires primefaces jar file to be included in the library of web application. Its the only effort needed to configure primfaces with eclipse in our web app. Include apache-commons-fileupload jar file in web app library. So now you have these two files in the web app library.
That’s it, primefaces setup is done for your app. Now we want to use primefaces components in a jsf page. Create index.xhtml as follows.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
When you declare xmlns:p="http://primefaces.org/ui" , you are able to use any primefaces component. Deploy application under tomcat, start it and hit url http://localhost:8080/PrimeFacesExamples/faces/index.xhtml . You’ll be able to see the beautiful primefaces editor displayed on browser.