title: Why we add @ModelAttribute("r") Reg reg in controller class?
body: <pre><code>@RequestMapping(value="/addpost",method=RequestMethod.POST)
      public ModelAndView addpost(HttpServletRequest request,HttpServletResponse response,@ModelAttribute("r") Reg reg)
      {
          int id=r.id;
          System.out.println(id);
          return mv;
      }
  </code></pre>
  
  <p>In this code,there is given @ModelAttribute("r") Reg reg.Wether this modelattribute is taking values from jsp page?Can anyone explains the working of this ModelAttribute?</p>