Announcement Announcement Module
Collapse
No announcement yet.
Binding error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Binding error

    Hello,

    Here is my situation:

    I have a MultiActionController and a "handle..." method defined in it:

    Code:
    public ModelAndView handleNewsAdd(HttpServletRequest request, HttpServletResponse response) throws ServletException {
            News currentNews = new News(); //this is my bean
            
            ServletRequestDataBinder binder = new ServletRequestDataBinder(currentNews, "currentNews");
            binder.bind(request);
    
            Map model = new HashMap();
            //setting some model parameters		
            . . . . . . . 
            return new ModelAndView("newsDetailsForm", "model", model);
    	}
    The request is correctly processed by this handler method and resolved to some .jsp file which contains the following definition:

    HTML Code:
        <form:form commandName="currentNews" name="NewsDetailsForm" ... >
        . . . . . . 
        </form:form>
    But in this stage I get an error:

    org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'currentNews' available as request attribute

    Where did I make a mistake?
Working...
X