Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Form Handling in Spring MVC

 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a newbie to spring. I just tried a Hello World and it worked fine. I am turing the same app into form handling. A simple login and password application where-in i would hit the server with a post method. My Current setup is as below.


Dispatcher servlet



login.jsp



When I hit http://localhost:8080/myapp/welcome i am being taken to welcome page... What needs to be done on the server to handle a form's post method? Do I need another controller or same will do... i read about modelAttributes, do I need them? Any help thanks.!
 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the page I get a

org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/pages/login.jsp at line 8



caused by
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'command' available as request attribute
 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it working from http://www.tutorialspoint.com/spring/spring_mvc_form_handling_example.htm
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic