title: In Spring MVC How to get form object in JSP from controller ?
body: <p>I am trying to get form object in jsp from controller.
  JSP :: updateuser.jsp </p>
  
  <pre><code>  &lt;form name="user" action="updateuser" method="post"&gt;
          &lt;ul&gt;
          &lt;li&gt;
              &lt;label&gt;User Name&lt;/label&gt; &lt;input type="text" name="userName" /&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;label&gt;Password&lt;/label&gt; &lt;input type="password" name="password" /&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;label&gt;FirstName&lt;/label&gt; &lt;input type="text" name="firstName" /&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;label&gt;LastName&lt;/label&gt; &lt;input type="text" name="lastName" /&gt;
          &lt;/li&gt;
          &lt;/ul&gt;
          &lt;button type="submit"&gt;Update&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Controller :: UpdateUserController.java</p>
  
  <pre><code>  @RequestMapping("/updateuser")
      public class UpdateUserController {
          @RequestMapping(method = RequestMethod.POST)
          public ModelAndView update(@ModelAttribute("user") User user,
                                         ModelMap model,HttpServletRequest request) {
  
              return new ModelAndView("updateuser","user",model);
          }
      }
  </code></pre>
  
  <p>after adding values in any field and clicking on update button. form gets submitted and in mapped POJO i'm getting value.
  Now I want to show those values in fields without adding into model object (i.e. <code>model.addAttribute("userName", user.getUserName()</code>) one by one all fields). Also i dont want to use Spring tag library. How i can populate all values in form ??</p>