• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

que in spring mvc - simpleformcontroller

 
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


 
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
 
I'm so happy! And I wish to make this tiny ad happy too:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!