On 5/9/07, Antony Stubbs <[EMAIL PROTECTED]> wrote:
Having staticJavascript=true generates *all* the validation functions specificed in struts-validators.xml (?) even if the form it's generating for only uses the REQUIRED validator. Is there a way to minimise the javascript generated?
Commons Validator 1.3.1 introduced a couple of things to help with this... The first is that included in the Commons Validator jar are "compressed" versions of all the validation script (for example as well as validateRequired.js there is also a validateRequired-compress.js) which are significantly smaller. Struts 1.3.8 shipped with a version of the validator-rules.xml file which is configured with the compressed javascript (called validator-rules-compressed.xml and can be found in src/core/src/main/resources/org/apache/struts/validator) See below for the second...
I'm going to try a work around, where I've extracted the generated javascript, and have put it in an external file that I will reference. Once I've decided which functions I am not going to use, I will remove them from this file.
Validator 1.3.1 ships with two files which contain all the scripts (compressed and uncompressed versions) which are in the binary distribution: commons-validator-1.3.1.js commons-validator-1.3.1-compress.js Niall --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]