Pattern selector

Most relevant patterns first. Most helpful ones displayed. Click here to show all.

  1. RequestContextAwareTag.doStartTag() has thrown an IllegalStateException
    Spring Web MVC
    8
    1
    0
  2. AbstractDataBoundFormElementTag.getName() has thrown an IllegalStateException
    Spring Web MVC
    36
    1
    2

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'foobar' available as request attribute
2 matching frames hidden
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:195)
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getName(AbstractDataBoundFormElementTag.java:161)
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.writeDefaultAttributes(AbstractDataBoundFormElementTag.java:124)
    at org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.writeDefaultAttributes(AbstractHtmlElementTag.java:409)
3 frames hidden

Solution

KP393 months ago
  • By default the model attribute name is taken as Bean class's name with first lowercase letter.
  • In the controller, you need to add the bean object as an attribute of the model:
  • Let's see the example,
@RequestMapping(value = "/", method = RequestMethod.GET) 
public String myMethod(Model model) { 
    model.addAttribute("bean", new Bean()); 
    return "bean"; 
}
  • Add this line into your controller : model.addAttribute("bean", new Bean());
  • By doing this the form which expects a backing object naming "bean" will be made available to it.

External results for this pattern (10)

  1. christlangvia GitHub3 months ago
    Neither BindingResult nor plain target object for bean name 'period' available as request attribute
    Show stack trace
  2. CLINT V2via Stack Overflow3 months ago
    Neither BindingResult nor plain target object for bean name 'p' available as request attribute
    Show stack trace
  3. Rohan Bosevia Stack Overflow4 months ago
    Neither BindingResult nor plain target object for bean name 'mstUsermaster' available as request attribute
    Show stack trace
  4. FooBayovia Stack Overflow4 months ago
    Neither BindingResult nor plain target object for bean name 'command' available as request attribute
    Show stack trace
  5. Neither BindingResult nor plain target object for bean name 'command' available as request attribute
    Show stack trace
  6. Neither BindingResult nor plain target object for bean name 'login' available as request attribute
    Show stack trace
  7. Unknown authorvia blogspot.com4 months ago
    Neither BindingResult nor plain target object for bean name 'display' available as request attribute
    Show stack trace
  8. Shyamvia Stack Overflow4 months ago
    Neither BindingResult nor plain target object for bean name 'command' available as request attribute
    Show stack trace
  9. Unknown authorvia jeromejaglale.com4 months ago
    Neither BindingResult nor plain target object for bean name 'carManager' available as request attribute
    Show stack trace
  10. Kaitisvia Stack Overflow4 months ago
    Neither BindingResult nor plain target object for bean name 'command' available as request attribute
    Show stack trace