favicon.ico未找到错误? [英] favicon.ico not found error?

查看:741
本文介绍了favicon.ico未找到错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have an application that uses Spring Security 3 runs on Tomcat. I didn't define any favicon for my website however when I run my application from my IDE sometimes after I login from my login pages it redirects my page to:

http://localhost:8080/favicon.ico

并说:

404 Not Found

此处有一个主题: http://论坛. springsource.org/showthread.php?100901-redirect-to-favicon.ico 但是我没有定义favicon.ico,Spring Security 3是否默认需要它(如果是,为什么有时会发生?)

There is a topic here: http://forum.springsource.org/showthread.php?100901-redirect-to-favicon.ico however I didn't define a favicon.ico does Spring Security 3 wants it by default(if yes, why it happens sometimes?)

推荐答案

以下是说明:

问题是,当浏览器缓存为空并且有用户进入时, 这是发生了什么:

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

  • 用户请求URL"/".此URL已被缓存.
  • 浏览器向"/favicon.ico"发出请求.这个网址变成 身份验证后重定向到的新URL.
  • 用户发布登录表单,并将其重定向到"/favicon.ico".
  • 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".

要解决此问题,您需要将"/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

这篇关于favicon.ico未找到错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆