| Author |
Validate method not completing
|
MaheshS Kumbhar
Ranch Hand
Joined: Sep 24, 2009
Posts: 188
|
|
I have following code, in which second if is not working in validate method.
In above code, even if I fail to enter name, second 'if' is not failing, its invoking execute method. Although 'if' clause for 'number' is working fine, means if I enter number less than 0, its addFieldError method is getting called.
What could be the problem with above code snippet?
|
I am slow but sure
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
|
You've checked if String's length is less than 0, you'll have to check if its == 0...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
Raza Mohd
Ranch Hand
Joined: Jan 20, 2010
Posts: 247
|
|
hi ..
Here you are getting a length 0.
It must be ==0
0r <=0
Thanks.
|
Good luck!!
A small leak can sink a Gigantic ship.>
|
 |
MaheshS Kumbhar
Ranch Hand
Joined: Sep 24, 2009
Posts: 188
|
|
Its working fine now Raza
|
 |
 |
|
|
subject: Validate method not completing
|
|
|