title: Spring simply rendering an html page
body: <p><strong>The problem:</strong></p>
  
  <p>Using Spring 4, I am getting this when visiting a webpage</p>
  
  <pre><code>Whitelabel Error Page
  
  This application has no explicit mapping for /error, so you are seeing this as a fallback.
  
  Fri Aug 15 16:41:29 BST 2014
  There was an unexpected error (type=Not Found, status=404).
  </code></pre>
  
  <p><strong>What I have:</strong></p>
  
  <p>I have this Main class:</p>
  
  <pre class="lang-java prettyprint-override"><code>// src/main/java/abc/Main.java
  package abc;
  
  import abc.web.WebAppConfig;
  import org.springframework.boot.SpringApplication;
  
  public class Main {
      public static void main(String[] args) {
          SpringApplication.run(WebAppConfig.class);
  
      }
  }
  </code></pre>
  
  <p>Then I have this WebAppConfig.class (currently with just some configuration annotations):</p>
  
  <pre class="lang-java prettyprint-override"><code>// src/main/java/abc/web/WebAppConfig.java
  package abc.web;
  
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.context.annotation.ComponentScan;
  
  @ComponentScan
  @EnableAutoConfiguration
  public class WebAppConfig {
  
  }
  </code></pre>
  
  <p>And this controller HomeController.java:</p>
  
  <pre class="lang-java prettyprint-override"><code>// src/main/java/abc/web/HomeController.java
  package abc.web;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import static org.springframework.web.bind.annotation.RequestMethod.GET;
  
  @Controller
  @RequestMapping("/")
  public class HomeController {
  
      @RequestMapping(method = GET)
      public String home() {
          System.out.println("HELLO !!");
          return "home";
      }
  }
  </code></pre>
  
  <p>The HELLO !! shows up in the logs.</p>
  
  <p>And finally I have a html file at <code>src/main/java/abc/webapp/home.html</code>, with just some html tags including a <code>p</code> tag with <code>Hello, world!</code>.</p>
  
  <p><strong>The question:</strong></p>
  
  <p>I understand that I am missing the way of rendering the view, but I searched a couple of questions on stackoverflow and haven't find a solution yet.</p>
  
  <p>Can someone explain how can I get Spring to render a webpage ? What am I missing ?</p>
  
  <p>Thanks in advance :)</p>