00.引用 Primefaces


Download primeFaces.jar


第二步:配置 web.xml

增加 primefaces 需要的 servlet

   <servlet>
        <servlet-name>Resource Servlet</servlet-name>
        <servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Resource Servlet</servlet-name>
        <url-pattern>/primefaces_resource/*</url-pattern>
    </servlet-mapping>



Example - XHTML

<!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>
    <title>test primefaces jsf 2.0</title>
</h:head>
<h:body bgcolor="white">
   
    <h:form id="helloForm">
        <p:editor/>
    </h:form>

</h:body>
</html>

Note: if you want to use PrimeFaces with NetBeans, choose Project> Libraries to add lib (can auto hint p:tags) and put it in /WEB-INF/lib directory (let primefaces work)

References


Develop Ajax-based JSF2 applications with PrimeFaces using Netbeans 6.8 by Christopher Lam

情人節後的 JSF PrimeFaces2.0 更完美了!

在JSF 中使用PrimeFaces 組件

Comments