• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

que in spring mvc - simpleformcontroller

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic