-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
PrimeFaces Beginner's Guide
By :
Perform the following steps to install and configure PrimeFaces to your web application:
web.xml:<servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping>
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
PrimeFaces-4.0.jar from http://www.primefaces.org/downloads.html and add it to classpath.pom.xml.<repository> <id>prime-repo</id> <name>Prime Repo</name> <url>http://repository.primefaces.org</url> </repository> <dependency> <groupId>org.primefaces</groupId> <artifactId>primefaces</artifactId> <version>4.0</version> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-api</artifactId> <version>2.2.3</version> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> <version>2.2.3</version> </dependency>
We have configured PrimeFaces repository and primefaces-4.0.jar dependency in our maven pom.xml, so that the PrimeFaces library is available to the web application classpath. We have configured FacesServlet and mapped to the URL pattern *.jsf, other popular URL patterns used are /faces/*, *.faces, and *.xhtml.
The PrimeFaces libraries from 4.0 version will be available in Maven Central, so you need not configure the PrimeFaces repository. But if you want to use snapshot versions, you need to configure the PrimeFaces repository in pom.xml.
Change the font size
Change margin width
Change background colour