It's not a secret anymore!*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 1511
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: 1511
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: 1511
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
 
Similar Threads
WARN [org.springframework.web.servlet.PageNotFound]No mapping found for HTTP request, error-code404
Not able to Validate form using JSR-303 validation implementation in Spring MVC
spring mvc with tiles hibernate validator @valid giving error
Can't read from 'messages.properties' file
Spring 3.1 MVC -- Neither BindingResult nor plain target object for bean name available as request