title: how to properly use Models on Spring 4?
body: <p>I am new using Spring's MVC (but Ive been using it for some years at other php frameworks).</p>
  
  <p>I have many doubts, I read the spring info and seems to be right and all.. then Ichecked this tutorial <a href="http://javahash.com/spring-4-mvc-hello-world-tutorial-full-example/" rel="nofollow">http://javahash.com/spring-4-mvc-hello-world-tutorial-full-example/</a> and it works and all, but on the controller part, there is a code I dont understand, and Id like to know how to properly use the Models on Spring.</p>
  
  <p>As far as I know, the models should call make the calls to the db, so, what about the services (interfaces and implementations) and the DTOs?</p>
  
  <p>At the example they make something like this:</p>
  
  <pre><code>@Controller
  public class HelloWorldController { 
  
      @RequestMapping("/hello")
      public String hello(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) {
          model.addAttribute("name", name);
          return "helloworld";
      }
  
  }
  </code></pre>
  
  <p>It receives a model as parameter... I bet if there is any, Spring would use a default one, what if I want to add more interaction and lets say, specifiy a model to call the db? Any idea how I could do that? </p>
  
  <p>And if I want to add a service... I am a little bit clueless about it, if someone could help me to understand...</p>
  
  <p>Thanks in advance</p>