This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Neither BindingResult nor plain target object for bean name 'cmd' available as request attribute

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to Spring and I am not able to solve this issue. I read almost all the post regarding this issue but I am not able to figure out the problem in my code.

java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'cmd' available as request attribute

I am getting this error only at the loading of the page for the first time. In edit mode it works perfectly fine.

Controller Class Object

JSP

Bean

Object


Any help will be appreciated.

Thanks,
Parth
 
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator




In summary, you need to define the commandClass CmdMasterModule and bind it with command name "cmd". Your bean configuration is not correct so, it won't work. Reconfigure and see if that help...
 
Parth Patel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tommy Delson,

The command class is already defined. I didn't understood what exactly you mean to say. The same structure is applied everywhere in the project and everything else runs perfect. I am not able to understand why only this module fails to load for the first time.

Did you mean to say that I need to set the command class and command name in the constructor of the controller ?

for e.g :


I tried it with the above code too but it didn't help.


Please can you give me an example related to my code or explain a little more detail about the code ?

Thanks,
Parth
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can once try with form binding?
Can you show us your complete code, because i can't see id used in controller, declared anywhere and also JSP, so that we can see the taglib used for <spring:bind>.

P:S: Still having controllers extend the spring classes, its been deprecated from spring 3.0 and will be removed in the future, I would recommend to use annotations instead of SimpleFormControllers.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic