Re: trimming fields in bean and html tags

2003-03-26 Thread David Graham
You should trim the spaces in an Action before populating the form fields.

David



From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: trimming fields in bean and html tags
Date: Wed, 26 Mar 2003 12:18:18 -0600
Hi all,

I'm forced to live with a db where many columns are chars instead of
varchars.  In cases where the contents of the char column doesn't fill the
space allowed, I get my result padded with spaces.  The practical problem
that this introduces is that if I want to use the validator to enforce
length restrictions (where the max length is the db column width), a user
can't just put his cursor at the end of the visible text and start typing
because of all the spaces.  I was hoping for a way to specify in bean:write
and html:text to trim any extra spaces but see no such option.  Any
suggestions?
thanks

john

john gregg
Wells Fargo Services Company
Minneapolis, MN


_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: trimming fields in bean and html tags

2003-03-26 Thread Wendy Smoak
John wrote:
 I'm forced to live with a db where many columns are chars intstead of
varchars
 ...
 Any suggestions?

How is the data getting from the database into the form?  Is there a DAO
layer?  Speaking from my own project, I would either do this in the DAO, or
else (and I don't know how to do this yet, but I've heard it's possible)
register a custom converter that BeanUtils would use when 'copyProperties'
is called to copy to values from the DTO to the form bean.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management