0

I am trying to integrate HDIV with my web application using HDIV struts 1.jar

I encounter the below error when trying to load the login page.

(self-tuning)'][][](org.hdiv.logs.Logger) - HDIV_PARAMETER_DOES_NOT_EXIST;/abc/def/index.do;_HDIV_STATE_;;;127.0.0.1;127.0.0.1;anonymous;

Possible checks I did:

  1. tried with addition of struts--el tag lib with HDIV--el tag lib
  2. tried with filter mapping pattern to all url

Not sure where I am going wrong. Many searches do not provide me a proper solution. Any guidance is highly appreciated. Thank you

Here are my config files.

hdiv-config.xml. I named it as struts-config-hdiv.xml

<hdiv:config excludedExtensions="css,png,gif,jpg,html,js" protectedExtensions=".*.do">
</hdiv:config> 

<hdiv:config>
    <hdiv:startPages>/index.html</hdiv:startPages>
    <hdiv:startPages>/fsm/efsm/index.do</hdiv:startPages>
</hdiv:config>

<hdiv:config errorPage="/fsm/jsp/tiles/common/ErrorPage.jsp">
        <hdiv:startPages>/index.html</hdiv:startPages>
        <hdiv:startPages>/fsm/efsm/index.do</hdiv:startPages>
</hdiv:config>

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

<hdiv:config showErrorPageOnEditableValidation="true">
</hdiv:config> 

<hdiv:config maxPagesPerSession="5">
</hdiv:config> 

<hdiv:config avoidValidationInUrlsWithoutParams="true">
</hdiv:config> 

` web.xml

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/struts-config/struts-config-hdiv.xml</param-value>
</context-param>

<filter>
    <filter-name>ValidatorFilter</filter-name>
    <filter-class>org.hdiv.filter.ValidatorFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>ValidatorFilter</filter-name>
    <url-pattern>*.do</url-pattern>
</filter-mapping>

<listener>
   <listener-class>org.hdiv.listener.InitListener</listener-class>
</listener>

<servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>
        org.apache.struts.action.ActionServlet
    </servlet-class>
    <init-param>
        <param-name>config</param-name>
        <param-value>
            /WEB-INF/struts-config/struts-config-default.xml
        </param-value>
    </init-param>
    <init-param>
        <param-name>config/hdiv</param-name>
        <param-value>
            /WEB-INF/struts-config/struts-config-hdiv.xml
        </param-value>
    </init-param>
    <init-param>
        <param-name>debug</param-name>
        <param-value>3</param-value>
    </init-param>
    <init-param>
        <param-name>detail</param-name>
        <param-value>3</param-value>
    </init-param>
    <init-param>
        <param-name>validating</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
</servlet-mapping>

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
</welcome-file-list>

 <taglib>
    <taglib-uri>/WEB-INF/tld/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/hdiv-html.tld</taglib-location>
</taglib>
<taglib>
    <taglib-uri>/WEB-INF/tld/struts-nested.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/hdiv-nested.tld</taglib-location>
</taglib>
<taglib>
    <taglib-uri>/WEB-INF/tld/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/hdiv-logic.tld</taglib-location>
</taglib> 
<taglib>
    <taglib-uri>/WEB-INF/tld/struts-html-el.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/hdiv-html-el.tld</taglib-location>
</taglib> 
<taglib>
    <taglib-uri>/WEB-INF/tld/struts-logic-el.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/hdiv-logic-el.tld</taglib-location>
</taglib> 

` pom.xml

<dependency>
<groupId>org.hdiv</groupId>
    <artifactId>hdiv-config</artifactId>
    <version>3.3.0</version>
</dependency>
<dependency>
    <groupId>org.hdiv</groupId>
    <artifactId>hdiv-struts-1</artifactId>
    <version>3.3.0</version>
</dependency>
kitcha
  • 5
  • 1
  • 6

1 Answers1

0

According to your post I see two possible solutions:

  • You must process the reported URL at server side using the custom tags offered by Struts 1 to render linksr. In that way Hdiv will include the additional hdiv parameter.

  • If the URL is a start page (the entry point to the application) where the user starts the browsing (in that case you are not rendering the link) you must define a start page within Hdiv configuration.

    <hdiv:config>
    <hdiv:startPages>XXX the URL XX</hdiv:startPages>
    

Regards,

Roberto Velasco (Hdiv Security)

rbelasko
  • 626
  • 3
  • 5