Results 1 to 2 of 2

Thread: Problem in jsps with formBackingObject and Errors model

  1. #1
    Join Date
    Aug 2004
    Location
    Montreal, Canada
    Posts
    35

    Default 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:

    Code:
    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:

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

    Any ideas?????

  2. #2
    Join Date
    Aug 2004
    Location
    Amsterdam, Netherlands
    Posts
    450

    Default

    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,

    Alef

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •