Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring mvc:resource not finding *.ico files
    primarykey
    data
    text
    <p>I have had a really hard time getting my Spring 3.0 application to recognize <code>favicon.ico</code> type files as a resource. I have defined my resource directory in my <code>spring-context.xml</code> file as follows:</p> <pre><code>&lt;mvc:resources mapping="/ui/**" location="/ui/" /&gt; </code></pre> <p>This directory structure looks like:</p> <pre><code>/ui /images /styles /scripts ... </code></pre> <p>Spring hosts my images, scripts, and styles just fine. However, I get a 404 error when trying to retrieve any <code>*.ico</code> files in the images directory. All PNG, GIF, and JPG images work just fine in that same directory. I tried being more specific on which directories to host and even specified <code>.ico</code> files as resources in the <code>context.xml</code> file and still get the same results:</p> <pre><code>&lt;mvc:resources mapping="/ui/images/*.ico" location="/ui/images" /&gt; </code></pre> <p>I've also tried adding a servlet mapping to the default servlet. This seemed to work for some when I researched online, but has not proven successful for me.</p> <pre><code>&lt;servlet-mapping&gt; &lt;servlet-name&gt;default&lt;/servlet-name&gt; &lt;url-pattern&gt;*.ico&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>EDIT: I have also added the favicon.ico file to the root path of the web app. If I use a png file for the favicon, it works in every browser but IE. I would like to solve this problem for all browsers if possible. Any help at this point would be greatly appreciated.</p> <p>EDIT2: I already have a link tag in the XHTML document:</p> <pre><code>&lt;link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/ui/images/favicon.ico" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload