title: Form validation errors are not displayed in JSP page using Spring 3.1
body: <p>I can not get the validation error messages to be showed in JSP page. Here is my controller:</p>
  
  <pre><code>@Controller
  @RequestMapping("/secure")
  @SuppressWarnings({"All"})
  public class OperationController {
  
      @ModelAttribute("crawler/operation")
      public OperationForm operationForm() {
          return new OperationForm();
      }
  
      @RequestMapping(value = "crawler/operation/create", method = RequestMethod.POST)
      public String processCrawlerOperationForm(@Valid OperationForm operationForm, BindingResult result, Map model) {
          if (result.hasErrors()) {
              HashMap&lt;String, String&gt; errors = new HashMap&lt;String, String&gt;();
              for (FieldError error : result.getFieldErrors()) {
                  errors.put(error.getField(), error.getDefaultMessage());
              }
              model.put("errors", errors);
              return "crawler/operation";
          }
          //Some logic
          return "crawler/operation";
      }
  
  }
  </code></pre>
  
  <p>I am 100% sure that errors exits. I have been debugging this code to be sure that there are errors. </p>
  
  <p>My form class:</p>
  
  <pre><code>public class OperationForm {
  
      @NotEmpty
      private String operationName;
  
      @NotEmpty
      private String author;
  
      @NotEmpty
      private String configurationId;
  
      public String getOperationName() {
          return operationName;
      }
      //Getters and setters
  }
  </code></pre>
  
  <p>My JSP spring form:</p>
  
  <pre><code>&lt;form:form action="${pageContext.servletContext.contextPath}/secure/crawler/operation/create.htm" commandName="crawler/operation"&gt;
      &lt;table border="0" cellspacing="12"&gt;
          &lt;tr&gt;
               &lt;td&gt;
                   &lt;spring:message code="application.operationForm.operationName"/&gt;
               &lt;/td&gt;
               &lt;td&gt;
                  &lt;form:input path="operationName"/&gt;
               &lt;/td&gt;
               &lt;td class="error"&gt;
                  &lt;form:errors path="operationName"/&gt;
               &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
               &lt;td&gt;
                   &lt;spring:message code="application.operationForm.author"/&gt;
               &lt;/td&gt;
               &lt;td&gt;
                  &lt;form:input path="author"/&gt;
               &lt;/td&gt;
               &lt;td class="error"&gt;
                  &lt;form:errors path="author"/&gt;
               &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
               &lt;td&gt;
                   &lt;spring:message code="application.operationForm.configuration"/&gt;
               &lt;/td&gt;
               &lt;td&gt;
                  &lt;form:input path="configurationId"/&gt;
               &lt;/td&gt;
               &lt;td class="error"&gt;
                  &lt;form:errors path="configurationId"/&gt;
               &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
               &lt;td&gt;
                   &lt;input class="button" type="submit" value="Vykdyti"/&gt;
               &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form:form&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>