gpt4 book ai didi

web - favicon.ico 未找到错误?

转载 作者:行者123 更新时间:2023-12-03 23:32:50 29 4
gpt4 key购买 nike

我有一个使用 Spring Security 3 在 Tomcat 上运行的应用程序。我没有为我的网站定义任何图标,但是当我从我的 IDE sometimes 运行我的应用程序时从我的登录页面登录后,它会将我的页面重定向到:

http://localhost:8080/favicon.ico

并说:
404 Not Found

这里有一个话题: http://forum.springsource.org/showthread.php?100901-redirect-to-favicon.ico但是我没有定义 favicon.ico 默认情况下 Spring Security 3 是否需要它(如果是,为什么有时会发生?)

最佳答案

这是解释:

The issue is, when the browser cache is empty and a user comes in, here is what happens:

  • the user requests URL "/". This URL is cached.
  • the browser makes a requests to "/favicon.ico". This URL becomes the new URL where to redirect to upon authentication.
  • the user posts the login form and is redirected to "/favicon.ico".

To fix this, you need to set "/favicon.ico" as being a non-secured resources:

<intercept-url pattern="/favicon.ico" access="ROLE_ANONYMOUS" />


取自: http://blog.idm.fr/2010/09/spring-security-redirecting-to-faviconico.html

关于web - favicon.ico 未找到错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7413304/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com