This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes Not getting the validation message in my example. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Not getting the validation message in my example." Watch "Not getting the validation message in my example." New topic
Author

Not getting the validation message in my example.

Rahul Ba
Ranch Hand

Joined: Oct 01, 2008
Posts: 205

Hi all,

I am trying to code some of the basic example in spring.In the following code, I am not able to show validation messages.


index.jsp




2.loginFormController.java







3.LogonFormValidator.java




4.springapp-servlet.xml






Question: so, when I do not enter anything in username input field, I am not able to see error messages? Any reason?

Thanks in advance.

Rahul
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Don't know, but wouldn't you want to validate the password regardless of username validation failure?
Rahul Ba
Ranch Hand

Joined: Oct 01, 2008
Posts: 205
Hi david,

No, I am just learning the Spring MVC ..hence just want to validate username.

Rahul
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Hmm. Well, more often than not, it's nicer to the user to give them all the error messages at once, rather than making them fill out the form n times.
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
I recommend to use Spring form tag.


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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Not getting the validation message in my example.
 
Similar Threads
spring mvc problem while doing Validation
simpleFormController problem.
Backend validation - a complete example
Compiler error in Action class - configuring data source in struts-config.xml. Please help!
Spring form input binding problem