aspose file tools*
The moose likes Spring and the fly likes Neither BindingResult nor plain target object for bean name 'cmd' available as request attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Neither BindingResult nor plain target object for bean name Watch "Neither BindingResult nor plain target object for bean name New topic
Author

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

Parth Patel
Greenhorn

Joined: Oct 13, 2011
Posts: 2
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
Tommy Delson
Ranch Hand

Joined: Apr 13, 2011
Posts: 206




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...

OCPJP6-05-11
"Your life is in your hands, to make of it what you choose."
Parth Patel
Greenhorn

Joined: Oct 13, 2011
Posts: 2
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
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 538

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Neither BindingResult nor plain target object for bean name 'cmd' available as request attribute