title: Spring lost model attribute between GET and POST
body: <p>The get method will prepare the model and send to the "add person" jsp
  <BR/>It will also set the "mode" attribute to be "add" (so add and edit can share same jsp)
  <BR/>When the processSubmit result hasErrors ,mode attribute is gone
  <BR/>How to maintain mode attribute between calls?</p>
  
  <pre><code>@RequestMapping(value="/people/def/add" , method = RequestMethod.GET)
  public String personAdd(@ModelAttribute("person") Person person,Model map) {        
      map.addAttribute("mode", "add");
      //DO SOME LOGIC
      return "personAdd";
  }
  
  @RequestMapping(value="/people/def/add" , method = RequestMethod.POST)
  public String processSubmit(@ModelAttribute("person") Person person,BindingResult result) { 
      personValidator.validate(person, result);
      if (result.hasErrors()) {
          //MODE ATTRIBUTE IS LOST
          return "personAdd";
  </code></pre>