title: Spring rest controller not returning html
body: <p>I'm using spring boot 1.5.2 and my spring rest controller looks like this</p>
  
  <pre><code>@RestController
  @RequestMapping("/")
  public class HomeController {
  
      @RequestMapping(method=RequestMethod.GET)
      public String index() {
          return "index";
      }
  
  }
  </code></pre>
  
  <p>when I go to <a href="http://localhost:8090/assessment/" rel="noreferrer">http://localhost:8090/assessment/</a> it reaches my controller but doesn't return my index.html, which is in a maven project under src/main/resources or src/main/resources/static. If I go to this url <a href="http://localhost:8090/assessment/index.html" rel="noreferrer">http://localhost:8090/assessment/index.html</a>, it returns my index.html.  I looked at this tutorial <a href="https://spring.io/guides/gs/serving-web-content/" rel="noreferrer">https://spring.io/guides/gs/serving-web-content/</a> and they use thymeleaf.  Do I have to use thymeleaf or something like it for my spring rest controller to return my view?</p>
  
  <p>My application class looks like this</p>
  
  <pre><code>@SpringBootApplication
  @ComponentScan(basePackages={"com.pkg.*"})
  public class Application {
  
      public static void main(String[] args) throws Exception {
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>When I add the thymeleaf dependency to my classpath I get this error (500 response code)</p>
  
  <pre><code>org.thymeleaf.exceptions.TemplateInputException: Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers
  </code></pre>
  
  <p>I guess I do need thymeleaf? I'm going to try and configure it properly now.</p>
  
  <p>It works after changing my controller method to return index.html like this</p>
  
  <pre><code>@RequestMapping(method=RequestMethod.GET)
  public String index() {
      return "index.html";
  }
  </code></pre>
  
  <p>I think thymeleaf or software like it allows you to leave off the file extension, not sure though.</p>