Siddiq Syed wrote:
Do anybody have an idea why this is not working.
There is validation for a numeric field which is a string in the action ,
The validation is through regular expression as show below.
<field name="caseNumber">
<field-validator type="requiredstring">
<message>Please enter a case number</message>
</field-validator>
<field-validator type="regex">
[0-9]{1,}
<message>Please enter a valid case number</message>
</field-validator>
</field>
As per struts
http://struts.apache.org/2.1.6/docs/regex-validator.html the default value
for trim is true,
The problem is validation is not happening if I give a space either at the
begining or at the ending of the case number in the text filed, basically
trim is not working for this field.
Do any body have any idea how to set trim to work. Or any other regular
expression where it can trim the the white spaces.
Did you try setting trim to true?
Any reasonable regex tutorial will give you the syntax for ignoring
arbitrary quantities of whitespace.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org