Struts 1

Hdiv installation steps for Struts 1 framework.

Before starting the installation check the environment setup.

Add Hdiv Dependencies

Add Hdiv dependencies to the web application project. To do this, add the following dependencies to the pom.xml file.



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

Copy TLD files

Hdiv has its own TLD files with the same Struts 1 tags but with Hdiv integration activated. To enable Hdiv the application have to load Hdiv TLD files instead Struts original ones.

Copy TLD files from folder META-INF inside hdiv-struts-1-x.x.x.jar library into the project, for example, in this location: /WEB-INF/tld/.


  • hdiv-html.tld
  • hdiv-logic.tld
  • hdiv-nested.tld
  • hdiv-tiles.tld

XML Config

Modify the web.xml file to include the Listener and the Hdiv filter:

<!-- Hdiv Init Listener -->
<!-- Hdiv Validator Filter -->

It is important that Hdiv's Listener should go after Spring's Listener ContextLoaderListener.

Add the Hdiv configuration file to the rest of Spring configuration files:

<!-- Spring Context Loader -->
  1. Create the 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=""
        <!-- Hdiv Base Configuration -->
        <hdiv:config excludedExtensions="css,png,gif,js,woff">
        <!-- Own Editable Validation -->
            <hdiv:validationRule url="/.*" />
  2. Use Hdiv TLD files.

    Replace Struts tld files with Hdiv tlds.

    <!-- Replace Struts 1 tld with Hdiv tlds -->


    After a TLD replacement, a complete JSP recompilation is required. Force your server working folder cleanup.