【问题标题】:Error showing images in a jsf page after implements spring security实现 Spring Security 后在 jsf 页面中显示图像时出错
【发布时间】:2014-12-08 03:09:19
【问题描述】:

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

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

当我尝试显示我收到此警告时更改文件夹后

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

chrome isspector显示的图片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 中的 /secured/ 会有所不同,因为 servlet 映射在 /file 之后

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

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

因此该文件夹没有任何访问限制

为什么图片没有显示,我该如何解决?

提前感谢您的时间和回答

【问题讨论】:

    标签: jsp jsf spring-security


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2017-02-07
      • 2020-09-24
      • 2014-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-26
      • 2015-01-28
      • 2019-05-05
      相关资源
      最近更新 更多