• Home
  • Prime Technology
  • Blog
  • Twitter
  • Facebook
PrimeFaces
Next Generation Component Suite
  • Resources

    • Getting Started
    • Why PrimeFaces
    • Downloads
    • Documentation
    • Theme Gallery
    • Multimedia
    • License
    • Issue Tracker
    • Source
    • FAQ
    • Donate
  • Support & Training

        
  • Online Demos

    • Showcase - Stable (2.1)
    • Showcase - Labs (2.2 - DEV)
    • Mock OS X
    • TouchFaces

Getting Started

First thing to do would be to download the necessary binaries, see the downloads section for more information.

Resource Servlet

PrimeFaces uses a servlet to stream bundled resources to the client. If you are using a Servlet 3.0 server like GlassFish 3, you can omit it as this servlet is auto-registered.

<servlet>
	<servlet-name>Resource Servlet</servlet-name>
	<servlet-class>
		org.primefaces.resource.ResourceServlet
	</servlet-class>
</servlet>

<servlet-mapping>
	<servlet-name>Resource Servlet</servlet-name>
	<url-pattern>/primefaces_resource/*</url-pattern>
</servlet-mapping>

Taglib

If you're a facelets user, the xml namespace configuration would be;

xmlns:p="http://primefaces.prime.com.tr/ui"

If you're using jsp (not recommended) the taglib definition is;

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

Resources Component for JSF 1.2

Resources component includes the css and script resources to tha page and is required when using PrimeFaces 1.x and JSF 1.2. If you're using PrimeFaces 2.x with JSF you can skip this section as native JSF2 apis are used in this case.

<head>
	<p:resources />
</head>

Test Run

Last thing to do is to add a component to your jsf page to see if everything is ok.

JSF 2.0 and PrimeFaces 2.x
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui">

	<h:head>

	<h:head>
	
	<h:body>
		<p:editor value="#{myBean.htmlText}" />
	</h:body>
</html>
JSF 1.2 and PrimeFaces 1.x with Facelets
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:p="http://primefaces.prime.com.tr/ui">

	<head>
		<p:resources />
	<head>
	
	<body>
		<p:editor value="#{myBean.htmlText}" />
	</body>
</html>
JSF 1.2 and PrimeFaces 1.x with JSP (Not Recommended)
<%@ taglib uri="http://primefaces.prime.com.tr/ui" prefix="p"%>
<html>
	<f:view>
		<head>
			<p:resources />
		<head>
	
		<body>
			<p:editor value="#{myBean.htmlText}" />
		</body>
	</f:view>
</html>
Powered by Prime Technology