title: How to switch from many @RequestParam arguments to @ModelAttribute in a Spring Controller method
body: <p>I' new to spring and i've managed to collect data from a form in a JSP view and to submit my form to a controller . From the data aquired from the view , i'm instantiating a model object , which also contains other model objects :</p>
  
  <pre><code>@RequestMapping(value = "/updateEntry", method = RequestMethod.GET)
  public RedirectView updateAction(ModelAndView model,
  @RequestParam(value = "name", defaultValue = "none") String selectedWaveName,
  @RequestParam(value = "id", defaultValue = "-1") int id,
  @RequestParam(value = "function", defaultValue = "none") String function,
  @RequestParam(value = "evidence", defaultValue = "none") String evidence,
  @RequestParam(value = "action", defaultValue = "none") String action,
  @RequestParam(value = "topicId", defaultValue = "-1") int topicId,
  @RequestParam(value = "topic", defaultValue = "none") String topic,
  @RequestParam(value = "topicDesc", defaultValue = "none") String topicDesc,
  @RequestParam(value = "waveId", defaultValue = "-1") int waveId,
  @RequestParam(value = "waveStart", defaultValue = "none") String waveStart,
  @RequestParam(value = "waveEnd", defaultValue = "none") String waveEnd)
  throws ParseException {
  
  DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
  Date dateStart = formatter.parse(waveStart);;
  Date dateEnd = formatter.parse(waveEnd);
  
  waveDAO.updateFormResults(new FormResults(id, 
  new Topic(topicId, topic, topicDesc), 
  new Wave(waveId, selectedWaveName, dateStart, dateEnd), 
  evidence, action, function));
  return new RedirectView("/hr/?name=" + selectedWaveName);
  }
  </code></pre>
  
  <p>How can i replace the whole @RequestParam lines with fewer lines using @ModelAttribute ?
  Do i also need to add the @ModelAttribute annotation to the model classes (FormResults , Topic , Wave) ?</p>
  
  <p>Thanks.</p>