Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: Release 1.4.3
-
Fix Version/s: Release 1.5
-
Component/s: Validation
-
Labels:None
-
Environment:All
Description
The maxlength and minlength @Validate parameters include any leading and trailing whitespace when they calculate the length of a field, similarly the required parameter will treat a field containing just spaces as if it is valid. To rectify this, it is proposed to add a new boolean parameter to @Validate: trim. If set, the contents of the field will be trimmed of leading and trailing spaces before performing the other validation checks.
I'd like to have a global option, perhaps in web.xml, to enable this behavior by default. The "trim" parameter of @Validate could override this global option (i.e. false to true or true to false).