[ https://issues.apache.org/struts/browse/STR-1955?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul Benedict closed STR-1955.
------------------------------
Resolution: Won't Fix
Assignee: (was: Struts Developers)
> [validator] automate maxlength validations
> ------------------------------------------
>
> Key: STR-1955
> URL: https://issues.apache.org/struts/browse/STR-1955
> Project: Struts 1
> Issue Type: Improvement
> Components: Core
> Affects Versions: 1.1 Final
> Environment: Operating System: other
> Platform: Other
> Reporter: Ralf Hauser
> Priority: Minor
>
> 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>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
|