title: Spring not serving html file
body: <p>So I am trying to follow this guide on how to serve html files with Spring:
  <a href="http://spring.io/guides/gs/serving-web-content/" rel="nofollow">http://spring.io/guides/gs/serving-web-content/</a></p>
  
  <p>I have the exact same folder structure with exact same files but when I run the spring boot server, my <code>localhost:8080/greeting</code> will only show the string <code>greeting</code> that is returned from the <code>GreetingController</code> and that's it, if I look at the page source code, there is no html in it.</p>
  
  <p>I could not find any related answers about this because all the similar answers still use the .xml file driven Spring where you declare the views in a .xml file. But this guide explicitly says that no .xml needs to be used. It should just work like that.</p>
  
  <p>Mapping:</p>
  
  <pre><code>@RestController
  public class GreetingController {
  
      @RequestMapping("/greeting")
      public String greeting(@RequestParam(value="name", required = false, defaultValue="World") String name, Model model) {
          model.addAttribute("name", name);
          return "greeting";
      }
  }
  </code></pre>
  
  <p>Using @Controller throws error: </p>
  
  <pre><code>2015-02-25 14:50:14.830 ERROR 2378 --- [nio-8080-exec-7] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Circular view path [greeting]: would dispatch back to the current handler URL [/greeting] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)] with root cause
  
  javax.servlet.ServletException: Circular view path [greeting]: would dispatch back to the current handler URL [/greeting] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Solution: 
  a) Use <code>@Controller</code> instead of <code>@RestController</code>
  b) When launching the application in IntelliJ, make sure you create a Gradle task that is ran before executing the Main class.</p>