title: Problems with controller in Spring MVC
body: <p>I am trying to create a jsp form for inputting the user information.
  I am using a controller to display the input page.
  I have added an User bean object with the modelmap.The controller returns the ModelandView object.
  The problem lies here.No model value gets returned to the jsp page. Anybody know why this happens??please help me...</p>
  
  
  
  <pre><code>&lt;context:annotation-config/&gt;
  &lt;context:component-scan base-package="com.mobilize.rest"/&gt;
  &lt;mvc:annotation-driven/&gt;
  
  &lt;bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/&gt;
  
  
  &lt;import resource="configuration/messageConverter.xml"/&gt;
  &lt;import resource="configuration/viewResolveContext.xml"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>The code below shows the controller used to get the view AddUSer.jsp page
  While debugging the values are properly stored in the object.
  But the problem is that the object doesnt get received at the form page.</p>
  
  <pre><code>@RequestMapping(value = "/AddUser.html", method = RequestMethod.GET)
  
  public ModelAndView addUser(
    @RequestParam(value = "reload", required = false, defaultValue = "false")
    Boolean reload,
    @RequestParam(value = "reset", required = false, defaultValue = "false")
    Boolean reset,HttpServletRequest request) {
  
      HttpSession httpSession = request.getSession();
      ModelMap modelmap = new ModelMap();
      Users users = new Users();
  
      modelmap.addAttribute("users", users);
      modelmap.addAttribute("MOB_USER_ADD_STATUS_SUCCESS_MESSAGE","trial");
  
      return new ModelAndView("AddUser", modelmap);
  }
  </code></pre>
  
  <p>[Edited, additional code moved from comment section]</p>
  
  <pre><code>&lt;div id="content" style="height:508px"&gt; &lt;br/&gt;  
    &lt;c:if test="${MOB_USER_ADD_STATUS_SUCCESS_MESSAGE!=null}"&gt; 
      &lt;div align="center" 
             id="statusIndicator"
          class="successMessage"&gt;${MOB_USER_ADD_STATUS_SUCCESS_MESSAGE}
      &lt;/div&gt; 
    &lt;/c:if&gt; 
    ${MOB_USER_ADD_STATUS_SUCCESS_MESSAGE} 
    &lt;form:form commandName="users" 
                    method="POST" 
                    action="AddUser.html"&gt; 
      &lt;table&gt; 
       &lt;tr&gt;
         &lt;td&gt; User Name: &lt;/td&gt;
         &lt;td&gt;&lt;form:input path="userName" 
                           id="username"&gt;
             &lt;/form:input&gt; 
         &lt;/td&gt; 
       &lt;/tr&gt; 
       &lt;tr&gt; 
         &lt;td&gt;&lt;/td&gt; 
         &lt;td&gt;&lt;form:errors path="userName" 
                      cssClass="errorMessage"&gt;
             &lt;/form:errors&gt;
         &lt;/td&gt; 
       &lt;/tr&gt; 
       &lt;tr&gt; 
         &lt;td&gt; Password: &lt;/td&gt; 
         &lt;td&gt; &lt;form:textarea path="password" id="password"&gt;&lt;/form:textarea&gt; &lt;/td&gt; 
       &lt;/tr&gt; 
       &lt;tr&gt; 
         &lt;td&gt;&lt;/td&gt; 
         &lt;td&gt;&lt;form:errors path="password" cssClass="errorMessage"&gt;&lt;/form:errors&gt;&lt;/td&gt;
       &lt;/tr&gt; 
       &lt;tr&gt; 
         &lt;td&gt;&lt;/td&gt; 
         &lt;td&gt; &lt;input type="submit" name="offer" value=" Add "/&gt; 
              &lt;input type= "reset" 
                     name="Reset" 
                    value=" Reset "
                  onclick="document.location.href='AddUser.html?reset=true'"/&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
     &lt;/table&gt; 
    &lt;/form:form&gt; 
  &lt;/div&gt;
  </code></pre>