title: Spring <mvc:annotation-driven /> and <mvc:resources can't use together?
body: <p>My application's folder structure is as follows.</p>
  
  <pre><code>web/WEB-INF/templates/
      -home.ftl
  
  web/resources/css/Home_files
      -test.css
  </code></pre>
  
  <p>When using both <code>&lt;mvc:annotation-driven /&gt;</code> and <code>&lt;mvc:resources mapping="/resources/**" location="/resources/css/Home_files" /&gt;</code>  tags it couldn't resolve view (http://localhost:8080/info/home/index.html).</p>
  
  <ul>
  <li>without <code>&lt;mvc:resources mapping="/resources/**" location="/resources/css/Home_files" /&gt;</code>  tag view is resolved but images ans css couldn't resolve.</li>
  <li>without <code>&lt;mvc:annotation-driven /&gt;</code>  tag view could not be resolved but images and css could be resolved.</li>
  </ul>
  
  <p>How do i load both view and static content together?</p>
  
  <p>here is my config xml files and homeController.</p>
  
  <h1>info-servlet.xml (configuration file)</h1>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:context="http://www.springframework.org/schema/context"
         xmlns:mvc="http://www.springframework.org/schema/mvc"
  
         xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context.xsd
         http://www.springframework.org/schema/cache
         http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
          "&gt;
  
  &lt;bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"&gt;
      &lt;property name="templateLoaderPath" value="/WEB-INF/templates/"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"&gt;
      &lt;property name="cache" value="true"/&gt;
      &lt;property name="prefix" value=""/&gt;
      &lt;property name="suffix" value=".ftl"/&gt;
  &lt;/bean&gt;
  
  &lt;context:component-scan base-package="com.test.web.controllers"/&gt;
  
  &lt;context:component-scan base-package="com.test"/&gt;
  
  &lt;mvc:annotation-driven /&gt;
  &lt;mvc:resources mapping="/resources/**" location="/resources/css/Home_files" /&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <h1>controller</h1>
  
  <pre><code>@Controller
  
  @RequestMapping("/home")
  
  public class HomeController {
  
      @RequestMapping(value = "/index.html")
  
      public String getHome(@ModelAttribute("model") ModelMap model) {
  
          return "home";
  
      }
  
  }
  </code></pre>
  
  <h1>web.xml</h1>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
            http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" &gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;
              /WEB-INF/spring/info-servlet.xml
          &lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;info&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/spring/info-servlet.xml&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;!-- The mapping for the default servlet --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;info&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  
      &lt;/servlet-mapping&gt;
  </code></pre>