title: Building Spring MVC application, Controller "Cannot find symbol" Model
body: <p>I first built my Spring MVC project with <code>gradle bootRun</code> with the following controller class successfully:</p>
  
  <pre><code>import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.ResponseBody;
  
  @Controller
  public class HelloController {
  
    @RequestMapping("/")
    public String hello() {
      return "resultPage";
    }
  }
  </code></pre>
  
  <p>Then I changed it to pass data to my view class:</p>
  
  <pre><code>import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.ResponseBody;
  
  @Controller
  public class HelloController {
  
    @RequestMapping("/")
    public String hello(Model model) {
      model.addAttribute("message", "Hello from the controller");
      return "resultPage";
    }
  }
  </code></pre>
  
  <p>When I build my project now, I get the following error:</p>
  
  <pre><code>HelloController.java:13: error: cannot find symbol
      public String hello(Model model) {
                          ^
    symbol:   class Model
    location: class HelloController
  1 error
  :compileJava FAILED
  
  FAILURE: Build failed with an exception.
  </code></pre>
  
  <p>Any ideas what I'm doing wrong?</p>