Primefaces

Add the following dependencies to your pom.xml file:

<dependency>
    <groupId>org.hdiv.ee</groupId>
    <artifactId>hdiv-ee-jsf</artifactId>
    <version>${org.hdiv-ee-version}</version>
</dependency>
<dependency>
    <groupId>org.hdiv.ee</groupId>
    <artifactId>hdiv-ee-config</artifactId>
    <version>${org.hdiv-ee-version}</version>
</dependency>
<dependency>
    <groupId>com.hdivsecurity</groupId>
    <artifactId>hdiv-primefaces</artifactId>
    <version>${com.hdiv-ee-primefaces}</version>
</dependency>

Note

Replace ${org.hdiv-ee-version} and `${com.hdiv-ee-primefaces} variables with the ones sent by our support team.

Modify web.xml file.

Add Hdiv filter, listener, Hdiv faces config and Hdiv configuration to the web.xml file.

<!-- Hdiv initialization listener -->
<listener>
    <listener-class>org.hdiv.listener.InitListener</listener-class>
</listener>
...
<!-- Hdiv Validator Filter -->
<filter>
    <filter-name>ValidatorFilter</filter-name>
    <filter-class>org.hdiv.filter.ValidatorFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>ValidatorFilter</filter-name>
    <servlet-name>Spring MVC Servlet</servlet-name>
</filter-mapping>
<filter-mapping>
    <filter-name>ValidatorFilter</filter-name>
    <url-pattern>*.xhtml</url-pattern>
</filter-mapping>
...
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/config/hdiv-config.xml</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>WEB-INF/config/hdiv-faces-config.xml</param-value>
</context-param>

Create hdiv-config.xml file

Create a new `hdiv-config.xml file with the basic content:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:hdiv="http://www.hdiv.org/schema/hdiv-ee"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.hdiv.org/schema/hdiv-ee http://www.hdiv.org/schema/hdiv/hdiv-ee.xsd">

    <hdiv:config confidentiality="false" avoidCookiesConfidentiality="true" maxPagesPerSession="10">
        <hdiv:sessionExpired homePage="/" loginPage="/"/>
        <hdiv:startPages method="get">,/</hdiv:startPages>
    </hdiv:config>

    <hdiv:editableValidations>
        <hdiv:validationRule url=".*"></hdiv:validationRule>
    </hdiv:editableValidations>

    <bean id="org.hdiv.validation.ComponentTreeValidator"
        class="com.hdivsecurity.primefaces.validation.PrimeComponentTreeValidator"
        init-method="createComponentValidators">
        <property name="config" ref="org.hdiv.config.HDIVConfig"/>
    </bean>
</beans>

Create hdiv-faces-config.xml file

Create a new `hdiv-faces-config.xml file with this content:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
    version="2.0">
    <component>
        <component-type>javax.faces.Parameter</component-type>
        <component-class>org.hdiv.components.UIParameterExtension</component-class>
    </component>
    <component>
        <component-type>javax.faces.HtmlInputHidden</component-type>
        <component-class>org.hdiv.components.HtmlInputHiddenExtension</component-class>
    </component>
    <!-- Primefaces components -->
    <component>
        <component-type>org.primefaces.component.PickList</component-type>
        <component-class>com.hdivsecurity.primefaces.component.PickListExt</component-class>
    </component>
    <lifecycle>
        <phase-listener>org.hdiv.phaseListeners.ComponentMessagesPhaseListener</phase-listener>
        <phase-listener>org.hdiv.phaseListeners.ConfigPhaseListener</phase-listener>
        <phase-listener>org.hdiv.phaseListeners.ValidatorPhaseListener</phase-listener>
    </lifecycle>
    <factory>
        <external-context-factory>org.hdiv.ee.context.ExternalContextFactoryWrapper</external-context-factory>
    </factory>
</faces-config>

Now the application is ready to go. Deploy the project to the server and start it.