title: how to display bindingresult errors on JSP page
body: <p>I have a requirement to display errors on JSP page.</p>
  
  <p>User enters credentials in login screen and it goes to logincontroller once login success user will be redirected to AccountsummaryController it has some backend calls to fetch data and display those data on landing page that is AccountSummary page. There could be possibility that some of the data may not be fetched for various reasons. I want those errors to be passed to the JSP page to show on landing page after successful login. Below is the code snippet of controller method in accountsummary controller. Also I am planning to have some validations in modelattribute i.e. stmtForm. I hope form errors also goes as part of the result.</p>
  
  <pre><code>@RequestMapping(method = { RequestMethod.GET }, value = "stmtSummary")
      public ModelAndView getStatementSummary(@ModelAttribute("stmtForm") StatementForm stmtForm, BindingResult result, ModelMap modelMap,  HttpServletRequest request, HttpServletResponse response)
              throws Exception {
  
      result.addError(new ObjectError("error1","unable to get account number"));
      result.addError(new ObjectError("error2","unable to get routing number"));
      if(result.hasErrors()){
          System.out.println("Total errors are &gt;&gt;&gt;&gt;"+result.getErrorCount());  // *this is getting printed as 2*
      }
  }
  </code></pre>
  
  <p>Here is the tag I am using in JSP page.</p>
  
  <pre><code>&lt;form:errors path="*"/&gt;
  </code></pre>
  
  <p>I am not able to display errors on the UI. I am not able to find the what is wrong here. Please help</p>