No mapping found for HTTP request with URI [/favicon.ico]

后端 未结 3 998
囚心锁ツ
囚心锁ツ 2021-02-04 08:18

I can\'t recall what I have changed on my code but whenever I click on any links on my web it gives me this :

WARN : org.springframework.web.servlet.PageNotFound         


        
相关标签:
3条回答
  • 2021-02-04 08:32

    The favicon.ico : icon in the browser tab

    Since Spring Security are using

    <filter-mapping>
      <filter-name>springSecurityFilterChain</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>
    

    Did you exclude the favicon.ico from filtering by Spring Security?

    <http pattern="/favicon.ico" security="none" />
    
    0 讨论(0)
  • 2021-02-04 08:35

    Try to locate favicon.ico in your html page as below:

    <html>
        <head>
          <link href="[YOUR_FAVICON_PATH]/favicon.ico" rel="icon" type="image/x-icon" />
        </head>
    </html>
    
    0 讨论(0)
  • 2021-02-04 08:41

    Most web browsers attempt to fetch a site's favicon at the root of the context with a request for the /favicon.ico resource automatically. In your case is not handled by any configured Spring mapping.

    If you have a favicon at /favicon.ico or in another location you could configure a mapping in Spring to resolve the request to a valid resource:

    <mvc:resources mapping="/favicon.ico" location="/favicon.ico" />
    
    0 讨论(0)
提交回复
热议问题