You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Harland <dh...@ufi.com> on 2007/06/18 17:06:44 UTC
Automatic trimming
If you are setting trim=true in a stringlength validation you obviously
want the data that is passed to the database to be the data you have
validated, not the data plus the spaces removed during validation which
is what is happening.
Is there any way to automatically trim data from textfields etc?
______________________________________________________________________
Ufi Limited
Registered in England No. 3980770
Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
learndirect Solutions Ltd
Registered in England No. 5081669
Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
UFI Charitable Trust
Registered in England No. 3658378
Registered Charity No. 1081028
Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
This email has been scanned by the MessageLabs Email Security System.
______________________________________________________________________
Re: Automatic trimming
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
> Is there any way to automatically trim data from textfields etc?
I don't believe so, but in S2 you could write a converter or an
interceptor to do it for you. In both cases you'll have to come up with
a convention that determines when trimming is applied.
http://struts.apache.org/2.x/docs/type-conversion.html
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org