title: HTTP Status 400 - Required Integer parameter 'id' is not present
body: <p>I have a problem when I build a Spring + Spring MVC + Hibernate + MySQL project.</p>
  
  <p>Everything works fine but when I get "editpage" and then want to post editing information into MySQL, I get the following error from my Tomcat: </p>
  
  <pre><code>HTTP Status 400 - Required Integer parameter 'id' is not present
  </code></pre>
  
  <p>Controller class</p>
  
  <pre><code>@RequestMapping(value = "/users/edit", method = RequestMethod.POST)
  public String saveEdit(@ModelAttribute("userAttribute") User user,
                         @RequestParam(value = "id", required =   
  true)Integer id, Model model){
  
      logger.debug("Received request to update person");
  
      user.setId(id);
  
      personService.edit(user);
  
      model.addAttribute("id", id);
  
      return "editedpage";
  }
  </code></pre>
  
  <p>Service class</p>
  
  <pre><code>public void edit(User user){
  
      logger.debug("Editing existing user");
  
      Session session = sessionFactory.getCurrentSession();
  
      User existingUser = (User) session.get(User.class, user.getId());
  
      existingUser.setLogin(user.getLogin());
      existingUser.setPassword(user.getPassword());
      existingUser.setReal_name(user.getReal_name());
  
      session.save(existingUser);
  }
  </code></pre>
  
  <p>My JSP page</p>
  
  <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  &lt;%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %&gt;
  &lt;%@ page language="java" contentType="text/html; charset=UTF-8"
       pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
  &lt;!-- Bootstrap core CSS --&gt;
  &lt;link href="&lt;c:url value="/resources/styles/bootstrap.min.css" /&gt;"        
  rel="stylesheet"&gt;
  &lt;script src="&lt;c:url value="../../resources/javascripts  
  /non-empty_validation_editpage.js"/&gt;"&gt;&lt;/script&gt;
  
  &lt;title&gt;Editing page&lt;/title&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;h1 style="text-align: center"&gt;Edit page&lt;/h1&gt;
  
  &lt;c:url var="saveUrl" value="/main/users/edit?id = ${userAttribute.id}"/&gt;
  &lt;form:form modelAttribute = "userAttribute" method = "POST" action =  
  "${saveUrl}"&gt;
  
  &lt;div style="width: 300px; height: 500px; margin: auto;"&gt;
  
  &lt;div class="form-group" &gt;
  &lt;form:label path = "id"&gt;id:&lt;/form:label&gt;
  &lt;form:input type = "id" name = "id" path = "id" disabled="true"  
  class="form-control" /&gt;
  
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
    &lt;form:label path = "login"&gt;Login&lt;/form:label&gt;
    &lt;form:input type = "login" name = "login" path = "login" class="form- 
  control"  placeholder="new login"/&gt;
  
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
  &lt;form:label path = "password"&gt;Password&lt;/form:label&gt;
  &lt;form:input type = "password" name = "password" path = "password" 
  class="form-control"  placeholder="new password"/&gt;
  
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
  &lt;form:label path = "real_name"&gt;Real name&lt;/form:label&gt;
  &lt;form:input type = "real_name" name = "real_name" path = "real_name" 
  class = "form-control"  placeholder = "new Real name"/&gt;
  
  &lt;/div&gt;
  
  &lt;input type="submit" class="btn btn-success" value="Save"  style="width:  
  300px"/&gt;
  
  &lt;/div&gt;
  
  &lt;/form:form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>