struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Siddiq Syed <>
Subject Trim for regex validator is not working
Date Wed, 13 May 2009 19:31:31 GMT

Hi all,

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 type="regex">
 	    <message>Please enter a valid case number</message>

As per struts  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.

Thanks in advance.


View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message