• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 157
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Eclipse.png
[Thumbnail for Eclipse.png]
 
vivek dhiman
Ranch Hand
Posts: 157
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Still not sorted.
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use the modelAttribute attribute of the Spring form tag to specify the model name you are binding to.
 
vivek dhiman
Ranch Hand
Posts: 157
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
All of life is a contant education - Eleanor Roosevelt. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic