Announcement Announcement Module
No announcement yet.
Problem in jsps with formBackingObject and Errors model Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem in jsps with formBackingObject and Errors model

    Hi to all,

    I'm continuously getting this error message:

    Error 500: Could not find Errors instance for bean 'reo' in request: add the Errors model to your ModelAndView via errors.getModel()

    Whenever I am trying to give a model to a jsp view using the formBackingObject method using code like this:

    protected Object formBackingObject(HttpServletRequest request) throws ServletException {
    			IReoDeliverable reo = Reo.getReo("REO601R-53-00-001","--");
    			return reo.getModel();
    and a spring bind in a jsp like this:

    <spring&#58;bind path="reo.reportNumber">
      <input type="text" name="reportNumber" value='<c&#58;out value="$&#123;status.value&#125;"/>'>	

    Any ideas?????

  • #2
    The formBackingObject is the object backing form, not the actual model. I guess the IReoDeliverable is the object you will be 'displaying' in your form? If so, return that, instead of reo.getModel() and everything be just fine.

    When you're overriding more methods in the form controller and methods to have to return a ModelAndView object, return errors.getModel(), just as the error says. If you do not override methods that return a ModelAndView object, you should not need to do this however.

    Hope this helps,