DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26485>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26485 automate maxlength validations Summary: automate maxlength validations Product: Struts Version: 1.1 Final Platform: Other OS/Version: Other Status: NEW Severity: Enhancement Priority: Other Component: Validator Framework AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] It appears to be good practice to execute a maxlength validation for all form fields, especially the ones eventually ending up in a database. To save the programmer all the configuration writing chores, I suggest to automate this in the following way: Assume there is a registration form with the field "private String loginName;" - if there is also a) int loginName_maxLength = 60; //adapt value to permitted field length in DB b) the below global "automateMaxLength" is set to "true" then i) always execute the "maxlength" validation rule (no need to list that in validation.xml) ii) always amend the '<html:text property="loginName"' in jsps using the registration form with 'maxlength="60"' as per http://jakarta.apache.org/struts/userGuide/struts-html.html#text and iii) if the below "autoOnChangeJS" is "true", amend the same '<html:text property="loginName"' with an 'onchange="MODAL_MAX_LENGHT_AUTOGENERATED_JAVA_SCRIPT"' for those who expect their visitors to have JavaScript enabled. The configuration block in the struts-config.xml thus should be enhanced with two properties: <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> ... <set-property property="automateMaxLength" value="true"/> <set-property property="autoOnChangeJS" value="true"/> ... </plug-in> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]