posted 22 years ago
Yes you can use javascript with struts tags. If you look at the tags you will see that they provide all the parameters that the regular HTML tags provide.
With the Validator plugin you can do both client sode as well as server side validations. The validator plugin generates the required Javascript for you.
It makes sense to have serverside validations because Javascript can be turned of on the browser. Or your client may be used in an enviroment where Javascript is not supported (Think Handhelds,cellphones,Any OS with no Javascript support,...).
I usually do basic validations on the client side like required field and numbers fall in a range. On the server side I do all the basic validations plus checking for duplicates and enforcement of other business rules.
Checking if a few strings are empty and that they fall within a particular range isn't going to overload your system
Regards
Ravi