title: Not showing error messages when I validate the form in Spring MVC
body: <p>I have a problem when i validate the form. the form takes into account validation, but the error messages are not displayed.</p>
  
  <p>Controller : </p>
  
  <pre><code>@RequestMapping(value = "/saveUser", method=RequestMethod.POST)
  public String addUtilisateur(@Valid user util, BindingResult bindingResult, Model model)throws Exception{   
      if(bindingResult.hasErrors()){
          model.addAttribute("user", new user()); 
          return "login";
      }
          metier.ajoutUser(util);
      return "login";
  }
  </code></pre>
  
  <p>User.java :</p>
  
  <pre><code>@Entity
  public class user implements Serializable{
  @Id
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  private Long idUser;
  @Column(unique=true)
  @NotEmpty
  private String login;
  @NotEmpty
  private String password;
  private String action;
  public String getLogin() {
      return login;
  }
  public void setLogin(String login) {
      this.login = login;
  }
  public String getPassword() {
      return password;
  }
  public void setPassword(String password) {
      this.password = password;
  }
  
  public Long getIdUser() {
      return idUser;
  }
  public void setIdUser(Long idUser) {
      this.idUser = idUser;
  }
  
  public String getAction() {
      return action;
  }
  public void setAction(String action) {
      this.action = action;
  }
  public user() {
      super();
      // TODO Auto-generated constructor stub
  }
  public user(String login, String password) {
      super();
      this.login = login;
      this.password = password;
  }
  </code></pre>
  
  <p>login.jsp :</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="f"%&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;f:form modelAttribute="user" action="saveUser" method="post"&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;Login&lt;/td&gt;
  &lt;td&gt;&lt;f:input path="login"/&gt;
  &lt;f:errors path="login" cssClass="errors"&gt;&lt;/f:errors&gt; &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Pass word&lt;/td&gt;
  &lt;td&gt;&lt;f:input type="password" path="password"/&gt;
  &lt;f:errors path="password" cssClass="errors"&gt;&lt;/f:errors&gt; &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;input type="submit" value="Login"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/f:form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>there's there a solution for that error messages are displayed well ??</p>