Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

que in spring mvc - simpleformcontroller

 
ganesh gowthaman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i am a newbie to spring..

i am trying to display a jsp page from simpleformcontroller & if user enters invalid data, the same jsp should be displayed with a error message.

when i enter invalid data & click on submit am getting :
SEVERE: Neither BindingResult nor plain target object for bean name 'LoginCommand' available as request attribute
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'LoginCommand' available as request attribute

Btw, successView is working fine...

can someone please help ?
Login.jsp


LoginController.java


SpringTask1-servlet.xml


 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not a right way to do. You should implement a Validator and inject it to the Controller.
http://static.springsource.org/spring/docs/2.5.x/reference/validation.html

You have to use the errors tag too.
http://static.springsource.org/spring/docs/2.5.6/reference/spring-form.tld.html#spring-form.tld.errors
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic