File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes validate for negative number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validate for negative number" Watch "validate for negative number" New topic
Author

validate for negative number

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 437
hi , how to we validate a number that should not contain negative number in validator ?

thanks in advance !
MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
hi...

use this in your validation.xml

<field property="propertyname" depends="required,integer,intRange">

hope this would help


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
you can also use 'validwhen' if you're using struts 1.2.x and do a test for >= 0


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validate for negative number
 
Similar Threads
validate number
Having trouble writing a method that factors negative numbers.
Struts 2 + validate int value.
WA #1.....word association
random numbers, returns a negative number?