title: Unable to access Image files from CSS in a Spring MVC Application
body: <p>I have a Spring MVC application from which I am trying to access a CSS file from a JSP file. The CSS in turns accesses an image file.</p>
  
  <p>The CSS works perfectly fine, but the image is not being displayed. I think there is a problem with addressing the image file. </p>
  
  <p>I tried absolute addressing as well as relative-addressing to get the image, but it just doesnt work.</p>
  
  <p>background-image: url("resources/mytheme/images/banner.jpg");<br>
  I also tried<br>
  background-image: url("../images/banner.jpg");</p>
  
  <p>Can anyone please help me?</p>
  
  <p>My webapp package is as follows  </p>
  
  <pre><code>webapp  
   -resouces  
     -mytheme  
       -CSS  
         -template.css  
       -Images  
         -banner.jpg  
   -WEB-INF  
     -jsp  
        -login.jsp  
     -web.xml  
     -dispatcher-servlet.xml  
  </code></pre>
  
  <p>My login.jsp is as follows</p>
  
  <pre><code>&lt;%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%&gt;
  &lt;%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;!-- Importing the style sheet for the termplate --&gt;
      &lt;link href="&lt;c:url value="/resources/mytheme/css/template.css" /&gt;" rel="stylesheet"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  Hello&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My CSS file is as follows:</p>
  
  <pre><code>#banner {
      text-align: center; 
      background-image: url("resources/mytheme/images/banner.jpg");
      background-repeat: no-repeat;
      background-size: 1500px 250px;
      height: 250px;
  }
  </code></pre>