aspose file tools*
The moose likes Spring and the fly likes Form Handling in Spring MVC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Form Handling in Spring MVC" Watch "Form Handling in Spring MVC" New topic
Author

Form Handling in Spring MVC

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1535
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.!

Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1535
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

Joined: Jun 22, 2005
Posts: 1535
Got it working from http://www.tutorialspoint.com/spring/spring_mvc_form_handling_example.htm
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Form Handling in Spring MVC