aspose file tools*
The moose likes Spring and the fly likes que in spring mvc - simpleformcontroller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "que in spring mvc - simpleformcontroller" Watch "que in spring mvc - simpleformcontroller" New topic
Author

que in spring mvc - simpleformcontroller

ganesh gowthaman
Greenhorn

Joined: Nov 25, 2009
Posts: 3
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

Joined: Jul 05, 2005
Posts: 1936
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


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: que in spring mvc - simpleformcontroller