title: What is the difference between return ModelAndView and return String in Spring MVC?
body: <p>I want to know the different between ModelAndView and String.</p>
  
  <pre><code>@RequestMapping(value="/")
      public ModelAndView mainPage() {
          return new ModelAndView("home");
  }
  </code></pre>
  
  <p>and the second piece of code is about returning String:</p>
  
  <pre><code>@RequestMapping(value="/")
      public String mainPage() {
          return "home";
  }
  </code></pre>