This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes numeric field validation using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "numeric field validation using struts" Watch "numeric field validation using struts" New topic

numeric field validation using struts

ashish kulkarni
Ranch Hand

Joined: Aug 15, 2002
Posts: 131
Has any one done input validation of numeric fields in
struts, like i want to validate number of digits after
decimal or lenght of the numeric field
like the valid values will be 123.34, but 1234.4 is invalid,
I am using dynavalidatorform , so would like some code
to put in validation.xml or in strutsvalidator
does any one have this kind of validation code,

John Rainey

Joined: Dec 05, 2002
Posts: 17
There are a standard number of validations that struts provides which are listed in the validator-rules.xml file. If you need to implement your own custom validations, you can add another rule to that xml file or create a new file to put your rule in. You just have to make sure to add it to the struts-config.xml file. To make your own rule, you just have to follow the standard method signature that the normal rules follow.
Let me know if this helps.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: numeric field validation using struts
It's not a secret anymore!