Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java HDIV:SpringMVC应用程序获取“;“未经授权的访问”;错误_Java_Spring_Jsp_Spring Mvc_Hdiv - Fatal编程技术网

Java HDIV:SpringMVC应用程序获取“;“未经授权的访问”;错误

Java HDIV:SpringMVC应用程序获取“;“未经授权的访问”;错误,java,spring,jsp,spring-mvc,hdiv,Java,Spring,Jsp,Spring Mvc,Hdiv,刚刚将HDIV spring MVC show case项目中的配置示例实现到我的web应用程序中,并配置了开始链接等,我可以在URL中看到HDIV状态参数 我已经将index.jsp配置为重定向到welcome.html页面,方法与show case项目中提到的相同,并且可以正常工作 问题是,如果我刷新welcome.html页面,我会得到一个错误“Unauthorized access”,或者如果我第二次访问welcome.html页面中的任何链接,它会抛出相同的错误。 从日志中我可以看到-

刚刚将HDIV spring MVC show case项目中的配置示例实现到我的web应用程序中,并配置了开始链接等,我可以在URL中看到HDIV状态参数

我已经将index.jsp配置为重定向到welcome.html页面,方法与show case项目中提到的相同,并且可以正常工作

问题是,如果我刷新welcome.html页面,我会得到一个错误“Unauthorized access”,或者如果我第二次访问welcome.html页面中的任何链接,它会抛出相同的错误。 从日志中我可以看到-

015-05-31 12:53:02,131 org.hdiv.logs.Logger - INVALID_COOKIE;/welcome.htm;cookie:AMCV_5C21123F5245AF0C0A490D45%40AdobeOrg;-2017484664%7CMCMID%7C04001757167802827442558962327640098514%7CMCAAMLH-1433633264%7C9%7CMCAAMB-1433633264%7CNRX38WO0n5BH8Th-nqAG_A%7CMCAID%7CNONE;;0:0:0:0:0:0:0:1;0:0:0:0:0:0:0:1;anonymous;
我必须在浏览器的匿名模式下再次打开页面才能访问它,这将在第二次尝试或刷新浏览器时再次抛出错误

我的示例配置-

<?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"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.hdiv.org/schema/hdiv http://www.hdiv.org/schema/hdiv/hdiv.xsd">

    <hdiv:config excludedExtensions="css,png,gif,jpeg,jpg,js,ico">
        <hdiv:sessionExpired loginPage="/login.htm" homePage="/"/>
        <!--  <hdiv:startPages>/attacks/.*</hdiv:startPages> -->


        <hdiv:startPages method="get">/,/login.htm,/logout.htm</hdiv:startPages>
        <hdiv:startPages method="post">/j_spring_security_check</hdiv:startPages>
        <hdiv:startParameters>_csrf</hdiv:startParameters>
    </hdiv:config>

    <!-- Accepted pattern within the application for all editable parameters (generated from textbox and textarea) -->
    <hdiv:validation id="safeText">
        <hdiv:acceptedPattern><![CDATA[^[a-zA-Z0-9@.\-_]*$]]></hdiv:acceptedPattern>
    </hdiv:validation>

    <!-- Finally, it's necessary to define editable data validation list for 
        the application -->
    <hdiv:editableValidations>
        <!--  <hdiv:validationRule url="/secure/.*"></hdiv:validationRule> -->
            <!-- Finally, it's necessary to define editable data validation list for 
        the application -->

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

        <hdiv:validationRule url="/safetext/.*" enableDefaults="false">safeText</hdiv:validationRule>
    </hdiv:editableValidations>

</beans>

/,/login.htm,/logout.htm
/j_弹簧_安全检查
_csrf
安全文本

您似乎正在客户端生成cookie。因此,HDIV没有注意到这一点。我认为您正在使用,并且它正在生成cookie

尝试禁用Cookie中的完整性:

    <hdiv:config avoidCookiesIntegrity="true">


我希望这会有帮助。

谢谢费尔南多的建议,但这没有帮助,相反,现在我甚至无法通过未经授权的访问访问我的起始页,因为它找不到HDIV参数。