Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.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
Spring mvc 嵌入式google文档查看器的Spring安全问题_Spring Mvc_Spring Security - Fatal编程技术网

Spring mvc 嵌入式google文档查看器的Spring安全问题

Spring mvc 嵌入式google文档查看器的Spring安全问题,spring-mvc,spring-security,Spring Mvc,Spring Security,我在SpringMVC应用程序中使用GoogleDocumentViewer和JSP来显示pdf文件。它工作得很好,直到SpringSecurity被添加到这个应用程序中,pdf文件才能被看到。添加Spring安全性之后,在应该显示pdf的地方,现在显示登录页面源代码。如果禁用Spring安全性,则可以查看pdf 我尝试过用permitAll以不同的方式更改拦截器url模式,包括GoogleDocURL,但这些更改都没有解决这个问题 这里是我使用Google文档查看器显示pdf的地方 <i

我在SpringMVC应用程序中使用GoogleDocumentViewer和JSP来显示pdf文件。它工作得很好,直到SpringSecurity被添加到这个应用程序中,pdf文件才能被看到。添加Spring安全性之后,在应该显示pdf的地方,现在显示登录页面源代码。如果禁用Spring安全性,则可以查看pdf

我尝试过用permitAll以不同的方式更改拦截器url模式,包括GoogleDocURL,但这些更改都没有解决这个问题

这里是我使用Google文档查看器显示pdf的地方

<iframe src="http://docs.google.com/gview?url=${fchPath}/invoice/pdfView?_invoicePath=${invoiceQueue.invoicePath}&embedded=true" style="width:100%; height:800px;"></iframe>
where=${fchPath}/invoice/pdfView?\u invoicePath=${invoiceQueue.invoicePath}将解析为调用Spring控制器的url,该控制器反过来下载pdf文件以在浏览器中显示

在启用Spring安全性的情况下,所有其他页面都按预期工作

这是我的spring安全xml

<beans:beans xmlns="http://www.springframework.org/schema/security"
    xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-3.2.xsd">

    <http auto-config="true" use-expressions="true">
        <intercept-url pattern='/user/**' access="hasRole('ROLE_USER')" />
        <intercept-url pattern='/invoice/**' access="hasRole('ROLE_USER')" />
        <intercept-url pattern='/settings/**' access="hasRole('ROLE_ADMIN')" />
        <intercept-url pattern='/report/**' access="hasRole('ROLE_USER')" />

        <form-login login-page="/index" default-target-url="/user/home"
            authentication-failure-url="/index?statusMessage=AUTH_FAILED" 
            username-parameter="userName"
            password-parameter="password" 
            authentication-failure-handler-ref="userAuthFailureHandler"
            authentication-success-handler-ref="userAuthSuccessHandler"/>
        <logout logout-success-url="/index?statusMessage=LOGOUT_SUCCESS" />
    </http>

    <authentication-manager>
        <authentication-provider user-service-ref="fchUserAuthService" ></authentication-provider>

    </authentication-manager>

</beans:beans>
fchUserAuthService是对用户进行身份验证的bean

我们将非常感谢您的帮助