nKognito
nKognito

Reputation: 6363

Spring MVC: favicon

I am using Spring MVC with such definition:

<servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
    </servlet>  
    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

But the problem that spring always trying to find /favicon.ico by default and as a result I can't render any page. How can I disable such behaviour?

Thank you

Upvotes: 0

Views: 1210

Answers (2)

Shaun the Sheep
Shaun the Sheep

Reputation: 22742

If you are using Spring Security, then make sure you have omitted the favicon request (and any other static resources) from the security filter chain.

Upvotes: 2

fmucar
fmucar

Reputation: 14558

It has nothing to do with spring mvc but that is the default behaviour of the browser you are using. Also that should not break anything at all and your app should work as normal even if it does not have an ico. (Unless you specifically coded to make it fail in case of missing ico)

Upvotes: 1

Related Questions