Yeap, that's what I'd do. Hubert
On 4/26/07, Givler, Eric <[EMAIL PROTECTED]> wrote:
The problem I'm having with it is how to use the converter when the DB type is java.lang.String, and the conversion target type (for the form) will be java.lang.String? Apologies on this -- I didn't notice the source and destination types. Even if they are the same data types, I can at least see if the destination type is a subclass of Actionform and format accordingly. Sound ok? -----Original Message----- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Thursday, April 26, 2007 12:37 PM To: Struts Users Mailing List Subject: Re: Struts/FormDef formatting question Then you'll have to have code to convert between the two. If you're using Formdef, you can put this logic in Converter and associate that converter with the field in the form you're using. If not, you'll have to handle this within your Action when you prepopulate your outgoing form or parse the incoming form. Hubert On 4/26/07, Givler, Eric <[EMAIL PROTECTED]> wrote: > Thanks for the quick response. > > The field in the db is to be stored stripped of formatting. However, the display and entry of the field should include the formatting. > > -----Original Message----- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 26, 2007 11:21 AM > To: Struts Users Mailing List > Subject: Re: Struts/FormDef formatting question > > > Your form field will come in as String. If you'll be storing the data > as string as well, maybe you don't need any more conversion between > the two. > > Hubert > > On 4/26/07, Givler, Eric <[EMAIL PROTECTED]> wrote: > > I was reading on the Formdef site about using a formatter (converter) for handling a phone number for dynamic form beans in Struts. I have a situation that is very similar to this but I'm not sure how to go about writing it. The existing table has numeric phone fields which will not be changed, and will have two new phone fields added which are varchar2(14). In the case of a converter, I could see writing one for the Numeric since I could say that the converter is going from Number to String. However, what about where the db field is String already? I'm trying to use iBATIS for the db layer. > > If this is the incorrect place to ask this question, can you point me to the correct one? > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]