title: EnableWebMvc throws ServletException: Could not resolve view with name
body: <p>Playing around with Spring Boot + MVC with static HTML pages, while noticed this thing:</p>
  
  <p>Firstly, what I have:</p>
  
  <p>Index controller:</p>
  
  <pre><code>@Controller
  public class IndexController {
  
      @RequestMapping("/")
      public String index() {
          return "index.html";
      }
  
      @RequestMapping("/{path:[^\\.]+}/**")
      public String forward() {
          return "forward:/";
      }
  }
  </code></pre>
  
  <p>The Html file is:<code>...\src\main\resources\static\index.html</code></p>
  
  <p>So when my main application class is:</p>
  
  <pre><code>@SpringBootApplication
  public class MyApplication extends WebMvcConfigurerAdapter {
  
      public static void main(String[] args) {
          SpringApplication.run(MyApplication.class, args);
      }
  }
  </code></pre>
  
  <p>Everything works well and in default path: <code>localhost:8080\</code> I get <code>index.html</code> page content</p>
  
  <p>But if I annotate Application class with <code>@EnableWebMvc</code></p>
  
  <pre><code>@SpringBootApplication
  @EnableWebMvc
  public class MyApplication extends WebMvcConfigurerAdapter {
  
      public static void main(String[] args) {
          SpringApplication.run(MyApplication.class, args);
      }
  }
  </code></pre>
  
  <p>I get exception: <code>javax.servlet.ServletException: Could not resolve view with name 'index.html' in servlet with name 'dispatcherServlet'</code>
  But according to <a href="http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/web/servlet/config/annotation/EnableWebMvc.html" rel="noreferrer">this spring doc</a> it is a valid configuration.</p>
  
  <p>Maybe someone can explain me why? Do I understand something wrong?</p>