在实现spring安全性后,在jsf页面中显示图像时出错



我有一个jsf应用程序,它使用servlet显示硬盘中的图像,现在我开始使用spring安全性,并将xhtml文件移到了另一个文件夹中。现在浏览器找不到图像。

在servlet中,我用"/file"定义了映射url

文件夹更改后,当我尝试显示时,我得到了这个警告

No mime type could be found for file /secured/file/repositorio/48/55/56/351/352.jsp

chrome ispector显示的图像url是

http://localhost:8080/WSysGED/secured/file/repositorio/48/55/56/351/352.jpg?pfdrid_c=true

但是如果我打这个ulr

http://localhost:8080/WSysGED/file/repositorio/48/55/56/351/352.jpg?pfdrid_c=true

图像显示在浏览器中

我不明白为什么url中的/security/会有所不同,因为servlet映射在/file 之后

在spring application-context-security.xml文件中,我定义了

<http pattern="/secured/file/**" security="none" />

这样文件夹就不会有任何访问限制

为什么图像没有显示,我该如何修复?

提前感谢您的时间和aswers

在所有错误的地方搜索后,我意识到我正在做像/file/*这样的映射servlet,我只是移动到/security/file/*并工作。

最新更新