title: BindingResult does not show any errors when there is an error
body: <p>I am using annotation based validation for one of my forms and I am not able to show any errors using the <strong>form:errors tag</strong> I used in JSP file. When I try to debug it, I found out that the BindingResult does not show any errors as well but I am leaving the textbox empty to test the validation. Any pointers are greatly appreciated why I am not able to validate it.</p>
  
  <p>Below is my Controller Class</p>
  
  <pre><code>@Controller
  public class RequestController {
  @RequestMapping(value = "/requestform", method = RequestMethod.GET)
  public ModelAndView request() {
  return new ModelAndView("requestform", "command", new RequestForm());
  }
  
  @RequestMapping(value = "/showResponse", method = RequestMethod.POST)
  public String showResponse(@ModelAttribute("berequest") @Valid RequestForm berequest, BindingResult errors,
      ModelMap model) {
  
  if (errors.hasErrors()) {
      return "requestform";
  } else {
  
  
  StringBuilder url = new StringBuilder()
              .append("http://" + berequest.getMachineName() + ":" + berequest.getPortNumber()
                  + "/service/Service/v1/get/").append("USERID=" + berequest.getUserId())
              .append(",")
              .append("debugflag=" + berequest.isDebugFlag()).append("/")
              .append(berequest.getAttributeNames());
  
      RestTemplate restTemplate = new RestTemplate();
  
      String result = restTemplate.getForObject(url.toString(), String.class);
  
      ObjectMapper mapper = new ObjectMapper();
      Object json = mapper.readValue(result, Object.class);
      String indented = mapper.defaultPrettyPrintingWriter().writeValueAsString(json);
  
      model.addAttribute("response", (indented));
  
      return "resultform";
      }
  }
  </code></pre>
  
  <p>Below is my model class-</p>
  
  <pre><code>import javax.validation.constraints.NotNull;
  
  import org.hibernate.validator.constraints.NotBlank;
  import org.hibernate.validator.constraints.NotEmpty;
  
  public class RequestForm {
  
  @NotNull
  @NotBlank
  @NotEmpty
  private String userId;
  
  .....
  }
  </code></pre>
  
  <p>Below is my requestform.jsp file</p>
  
  <pre><code>    &lt;fieldset&gt;
          &lt;legend&gt;User Details:&lt;/legend&gt;
              &lt;form:label path="userId" for="input-one" class="float"&gt;&lt;strong&gt;User Id:&lt;/strong&gt;&lt;/form:label&gt;&lt;br /&gt;
              &lt;form:input path="userId" class="inp-text" name="input-one-name" id="input-one" type="text" size="100" /&gt;
              &lt;form:errors path="userId" cssClass="error"/&gt;&lt;br /&gt;
  
      &lt;/fieldset&gt;
  </code></pre>
  
  <p>Below is my context.xml file</p>
  
  <pre><code>    &lt;!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure --&gt;
  
      &lt;!--  Allow proxys --&gt;
      &lt;aop:aspectj-autoproxy /&gt;
  
      &lt;!-- Enables the Spring MVC @Controller programming model --&gt;
      &lt;mvc:annotation-driven&gt;
              &lt;mvc:message-converters&gt;
                &lt;!--  Support AJAX processing with progressive rendering. Overrides HttpOutputMessage with RaptorResponseWriter --&gt;
              &lt;beans:bean class="com.host.kernel.filter.RaptorJacksonHttpMessageConverter"/&gt;                  
              &lt;/mvc:message-converters&gt;
  
  
      &lt;context:component-scan base-package="com.host.config" /&gt;
      &lt;context:component-scan base-package="com.host.app.raptor.controller" /&gt;        
  
      &lt;!-- Handles HTTP GET requests by efficiently serving up static resources 
           in the corresponding directory --&gt;
      &lt;resources mapping="/js/**" location="/js/" /&gt;
      &lt;resources mapping="/css/**" location="/css/" /&gt;
  
      &lt;!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory --&gt;
      &lt;beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;beans:property name="prefix" value="/WEB-INF/views/" /&gt;
          &lt;beans:property name="suffix" value=".jsp" /&gt;
      &lt;/beans:bean&gt;
  &lt;/beans:beans&gt;
  </code></pre>
  
  <p>Can anyone tell me what wrong I am doing here?</p>