struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Siddiq Syed <siddiq...@yahoo.com>
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>
	<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.

Thanks in advance.

Regards
Siddiq. 

-- 
View this message in context: http://www.nabble.com/Trim-for-regex-validator-is-not-working-tp23528434p23528434.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message