Meaningless Drivel is fun!
The moose likes Struts and the fly likes Validate method not completing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validate method not completing" Watch "Validate method not completing" New topic

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

Joined: Aug 03, 2008
Posts: 9405

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


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
Have you checked out Aspose?
subject: Validate method not completing
It's not a secret anymore!