title: Property on model attribute set in one controller method is not available in another controller method
body: <p>Following contains the code inside my controller class , i am using the method public String getRegistrationForm(Map model) to return a jsp-page with a spring form on it , in this method i am setting userTab.setIsMfaEnabled(new Boolean(true)) ,  upon submitting the form the method :
  public String registerUser(@ModelAttribute("user") UserTab user , BindingResult results , Map model)
  is invoked as the handler method , but in this method the property 'isMfaEnabled' of user attribute set in the previous method is null and the line:System.out.println("user.getIsMfaEnabled() is nul"); is printing in the logs . Kindly tell me what is wrong here . </p>
  
  <pre><code>@Controller
  @RequestMapping("/register")
  public class RegisterUserController {   
      @Autowired
      RegisterUserService registerUserService;
  
      @RequestMapping(value = "/registeruser.action" , method =     RequestMethod.POST)
      public String registerUser(@ModelAttribute("user") UserTab user , BindingResult results , Map&lt;String,Object&gt; model){
          System.out.println("executing regsiterUser ");
          if(user == null)
             System.out.println(", user is null");
          if(results == null)
             System.out.println("results is null");
  
          UserTabValiator userTabValidator = new UserTabValiator();
          if(user.getIsMfaEnabled() == null)
              System.out.println("user.getIsMfaEnabled() is nul");
          userTabValidator.validate(user, results);
          if(results.hasErrors()){
             return "registeruser";
          }
          try {
              boolean val = registerUserService.isExistingUsername(user.getLoginName());
              if(val){
                  System.out.println("username already exists");
                  model.put("message", "username already exists");
                  return "registeruser";
              }
             if(!val){
                 model.put("username", user.getLoginName());
                 model.put("message", "registration success ... ");
                 return "registrationsuccess";
             }            
          } catch (Exception e) {
              System.out.println("exception thrown");
              e.printStackTrace();
              return "errorpage";
          }
         return "errorpage";
   }
  
  
     @RequestMapping(value="/registeruser.view", method=RequestMethod.GET)
     public String getRegistrationForm(Map&lt;String,Object&gt; model){
         System.out.println("executing getRegistrationForm");
         if(registerUserService == null)
         System.out.println("register user service is null");
         try{
           ArrayList&lt;MfaQuestion&gt; allMfaQuestions = (ArrayList&lt;MfaQuestion&gt;) registerUserService.getAllMfaQuestions();
          UserTab userTab =  new UserTab();
          userTab.setIsMfaEnabled(true);
          model.put("user", userTab);
          model.put("message", "register new user");
          model.put("allMfaQuestions", allMfaQuestions);
          return "registeruser";
         }
         catch(Exception e){
             e.printStackTrace();
             model.put("user", new UserTab());            
             model.put("message", "unable to get MFA questions");
             return "registeruser";
         }
      }   
  }
  </code></pre>
  
  <p>UserTab Model Class :
              package com.persistance.beans;</p>
  
  <pre><code>        import java.util.Date;
  
          public class UserTab {
  
              private Integer userTabID;
              private String loginName;
              private String password;
              private Date created;
              private Date lastUpdated;
              private Date lastLoginAttempt;
              private Boolean isAccountLocked;
              private Integer loginFailsNumber;
              private Boolean isMfaEnabled;
              private UserMfaMap userMfaMap;
  
              public String toString(){
                  String str ="";
                  System.out.println("[userTabID , loginName ,  password");
                  return str;
  
              }
  
              public UserMfaMap getUserMfaMap() {
                  return userMfaMap;
              }
  
              public void setUserMfaMap(UserMfaMap userMfaMap) {
                  this.userMfaMap = userMfaMap;
              }
  
              public UserTab() {
                  super();
              }
  
  
              public String getLoginName() {
                  return loginName;
              }
              public void setLoginName(String loginName) {
                  this.loginName = loginName;
              }
              public String getPassword() {
                  return password;
              }
              public void setPassword(String password) {
                  this.password = password;
              }
              public Date getCreated() {
                  return created;
              }
              public void setCreated(Date created) {
                  this.created = created;
              }
  
  
              public Date getLastUpdated() {
                  return this.lastUpdated;
              }
              public void setLastUpdated(Date lastUpdated) {
                  this.lastUpdated = lastUpdated;
              }
              public Date getLastLoginAttempt() {
                  return lastLoginAttempt;
              }
              public void setLastLoginAttempt(Date lastLoginAttempt) {
                  this.lastLoginAttempt = lastLoginAttempt;
              }
              public Boolean getIsAccountLocked() {
                  return isAccountLocked;
              }
              public void setIsAccountLocked(Boolean isAccountLocked) {
                  this.isAccountLocked = isAccountLocked;
              }
              public Integer getLoginFailsNumber() {
                  return loginFailsNumber;
              }
              public void setLoginFailsNumber(Integer loginFailsNumber) {
                  this.loginFailsNumber = loginFailsNumber;
              }
              public Boolean getIsMfaEnabled() {
                  return isMfaEnabled;
              }
              public void setIsMfaEnabled(Boolean isMfaEnabled) {
                  this.isMfaEnabled = isMfaEnabled;
              }
  
              public Integer getUserTabID() {
                  return userTabID;
              }
  
              public void setUserTabID(Integer userTabID) {
                  this.userTabID = userTabID;
              }
  
          }
  </code></pre>
  
  <p>RegisterUser JSP page :</p>
  
  <pre><code>            &lt;form:form method="POST" action="${pageContext.request.contextPath}/register/registeruser.action" commandName ="user"&gt;
             &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;form:label path="loginName"&gt;UserName&lt;/form:label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="loginName" /&gt;&lt;/td&gt;
                  &lt;form:errors path="loginName" cssClass="error"/&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;form:label path="password"&gt;Password&lt;/form:label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="password" /&gt;&lt;/td&gt;
                  &lt;form:errors path="password" cssClass="error"/&gt;
              &lt;/tr&gt;
  
              &lt;div id="question1" class="questionblock"&gt;
              &lt;tr&gt;
                  &lt;form:select path="userMfaMap.question1" &gt; 
                  &lt;c:forEach items="${allMfaQuestions}" var="mfaQuestion"&gt;
                      &lt;form:option  value="${mfaQuestion.mfaQuestionId}"&gt;
                        &lt;c:out value="${mfaQuestion.mfaQuestion}" /&gt;        
                     &lt;/form:option&gt;                     
                  &lt;/c:forEach&gt;
                  &lt;/form:select&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                  &lt;td&gt;&lt;form:label path="userMfaMap.answer1"&gt;Answer:&lt;/form:label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="userMfaMap.answer1" /&gt;&lt;/td&gt;
                  &lt;form:errors path="userMfaMap.answer1" cssClass="error"/&gt;
              &lt;/tr&gt;
              &lt;/div&gt;
              &lt;div id="question2" class="questionblock"&gt;   
              &lt;tr&gt;
                  &lt;form:select path="userMfaMap.question2"&gt;
                  &lt;c:forEach items="${allMfaQuestions}" var="mfaQuestion"&gt;
                      &lt;form:option  value="${mfaQuestion.mfaQuestionId}"&gt;
                        &lt;c:out value="${mfaQuestion.mfaQuestion}" /&gt;        
                     &lt;/form:option&gt;                     
                  &lt;/c:forEach&gt;
                  &lt;/form:select&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;form:label path="userMfaMap.answer2"&gt;Answer:&lt;/form:label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="userMfaMap.answer2" /&gt;&lt;/td&gt;
                  &lt;form:errors path="userMfaMap.answer2" cssClass="error"/&gt;
              &lt;/tr&gt;
              &lt;/div&gt;
              &lt;div id="question3" class="questionblock"&gt;
              &lt;tr&gt;
                 &lt;form:select path="userMfaMap.question3"&gt;
                  &lt;c:forEach items="${allMfaQuestions}" var="mfaQuestion"&gt;
                      &lt;form:option  value="${mfaQuestion.mfaQuestionId}"&gt;
                        &lt;c:out value="${mfaQuestion.mfaQuestion}" /&gt;        
                     &lt;/form:option&gt;                     
                  &lt;/c:forEach&gt;
                  &lt;/form:select&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;form:label path="userMfaMap.answer3"&gt;Answer:&lt;/form:label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="userMfaMap.answer3" /&gt;&lt;/td&gt;
                  &lt;form:errors path="userMfaMap.answer3" cssClass="error"/&gt;
              &lt;/tr&gt;
              &lt;/div&gt;
  
              &lt;tr&gt;
                    &lt;td&gt;&lt;input type="submit" name="submit" value="Submit"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;  
          &lt;/form:form&gt;
  </code></pre>