This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Spring and the fly likes Neither BindingResult nor plain target object for bean name 'command' available as request attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Spring
Reply 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 'command' available as request attribute

vivek dhiman
Greenhorn

Joined: Aug 05, 2011
Posts: 26

Hi I am getting exception Neither BindingResult nor plain target object for bean name 'command' available as request attribute when run login form with <form:form> tags. It works fine with normal html code but spring's form tag giving be this exception. Please resolve. I am posting few files of code as below.
Login.jsp


Web.xml

Dispatcher_Servlet.xml

Controller :


Attached is the directory structure.
Thanks.


[Thumbnail for Eclipse.png]

vivek dhiman
Greenhorn

Joined: Aug 05, 2011
Posts: 26



Still not sorted.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1282

Use the modelAttribute attribute of the Spring form tag to specify the model name you are binding to.


[How To Ask Questions][Read before you PM me]
vivek dhiman
Greenhorn

Joined: Aug 05, 2011
Posts: 26

Thanks Bill for your reply. As i just started the use of <form:form> tags so its not clear for me yet. Can you please tell me how model attribute works & what changes should i have to apply in code to run it.

Regards.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1282

First of all don't implement Spring interfaces like Controller or extend Spring classes like SimpleFormController. Use the modern @Controller style instead. Have a look at this tutorial to get you started. It seems hard to find up-to date blogs out there anymore.

http://krams915.blogspot.com/2010/12/spring-3-mvc-using-modelattribute-in.html

You can scroll down and look at the editpage.jsp for the modelAttribute tag in action.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Neither BindingResult nor plain target object for bean name 'command' available as request attribute
 
Similar Threads
Spring MVC issue. 404 Error
Problem running app under Tomcat v7
WARN [org.springframework.web.servlet.PageNotFound]No mapping found for HTTP request, error-code404
Can't read from 'messages.properties' file
no WebApplicationContext found: no ContextLoaderListener registered?