HDIV参数不存在

时间:2017-07-07 04:36:26

标签: struts1 hdiv

我正在尝试使用HDIV struts 1.jar

将HDIV与我的Web应用程序集成

尝试加载登录页面时遇到以下错误。

(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;

我做的可能检查:

  1. 尝试添加带有HDIV的struts- -el标签库 - -el标签lib
  2. 尝试使用过滤器映射模式到所有网址
  3. 不确定我哪里出错了。许多搜索都没有为我提供适当的解决方案。任何指导都非常感谢。谢谢

    以下是我的配置文件。

    HDIV-config.xml中。我把它命名为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>
    

1 个答案:

答案 0 :(得分:0)

根据你的帖子,我看到两种可能的解决方案:

  • 您必须使用Struts 1提供的自定义标记处理服务器端的报告URL以呈现链接器。这样,Hdiv将包含额外的hdiv参数。

  • 如果URL是用户开始浏览的起始页(应用程序的入口点)(在这种情况下,您没有呈现链接),则必须在Hdiv配置中定义起始页。

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

此致

Roberto Velasco(Hdiv Security)