• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Form Handling in Spring MVC

 
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got it working from http://www.tutorialspoint.com/spring/spring_mvc_form_handling_example.htm
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic