title: Link/ include css in FreeMarker using Spring 3 MVC
body: <p>I am currently trying to include a css file in my FreeMarker *.ftl. I also have configured a resource folder in my servlet config xml file.</p>
  
  <pre><code>&lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt;
  </code></pre>
  
  <p>But how can I access my css file from my FreeMarker template?</p>
  
  <p>I simply tried the following but without success.</p>
  
  <pre><code>&lt;link href="/resources/css/style.css" rel="stylesheet"  type="text/css" /&gt;
  </code></pre>
  
  <p>The resource folder lies in the root of my spring MVC 3.0 application.</p>
  
  <pre><code>/web
    /resources
      /img
      /css
    /WEB-INF
      /templates
  </code></pre>
  
  <p>My Servlet root is defined as:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;springmvc&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;springmvc&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/web/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>My FreeMarker files are lying in the templates folder.</p>