Include dependencies

Include Hdiv libraries into the application.

In case you use Maven to manage dependencies add them to the pom.xml file.



Replace ${org.hdiv-version} variables with the ones sent by our support team.

Copy TLD file

Hdiv extends JSTL standard components in order to add security features. To enable these features it is necessary to replace JSTL TLD with Hdiv TLD for JSTL.

Copy TLD file into the project, for example in this location: /WEB-INF/tlds/hdiv-c.tld.

Modify web.xml

Modify the web.xml file to include the InitListener, ValidatorFilter and Hdiv TLD:


<!-- Hdiv Validator Filter -->

<!-- Replace JSTL tld with Hdiv tld-->

Spring framework configuration

Hdiv requires the use of Spring Framework in the application.

If the application doesn't use the Spring Framework, add the dependency and Spring's ContextLoaderListener in web.xmlfile.

    ...Spring configuration files...


Check that ContextLoaderListener is before InitListener in the web.xml file.

Hdiv configuration file.

This file is an XML file that follows the format of Spring configuration files.

For convention, its name should be hdiv-config.xml, located in the WEB-INF directory and its minimal content is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"

    <!-- Hdiv Base Configuration -->
    <hdiv:config excludedExtensions="css,png,gif,js,woff">

    <!-- Own Editable Validation -->
        <hdiv:validationRule url="/.*" />

Add the Hdiv configuration file hdiv-config.xml to the rest of Spring configuration files:

<!-- Spring Context Loader -->

Recompile JSPs

Force JSP recompilation in order to use the new TLD file. This operation is server dependent.

Stop the server and delete the folders that contain compiled JSPs.

  • Tomcat: {path-to-tomcat}/work/Catalina/localhost/
  • JBoss: {path-to-jboss}/standalone/tmp/
  • Websphere: {path-to-websphere}/AppServer/profiles/{ServerName}/temp/{NodeName}/server1/

Delete all the content of the folder to clean compiled JSP files of all applications in the server or choose a specific application folder to clean only one application.

After start the server it will compile the JSP files when necessary.