Hi Brad, i would not like to write a getter specific for formatting or conversion purposes if i already have one getter. I think itīs hard to maintain and may result in unexpected results. But i thank you for the opinion, i confess you i thought in doing this but have left the idea. thanks
Giovani Salvador ----- Original Message ----- From: "Brad Balmer" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, January 08, 2004 5:29 PM Subject: Re: html:text and converter > This may be considered a workaround instead of a fix to the problem but > have you considered writing another get property for your > dtIniRealProjecto value that returns the formatted value? > > Something like: > ... > private java.util.Date date = null; > > ... > public java.util.Date getDate() { > return this.date; > } > //Also create a pre-formatted String of the Date Object > public String getFormattedDate() { > java.text.SimpleDateFormat formatter = new > java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); > return formatter.format(getDate()); > } > ... > > > > > Giovani Salvador wrote: > > >Donīt worry Hubert....well, i will try explain more detailed.... > > > >I have a jsp page with the following tag > > > ><html:text name="projeto" property="dtIniRealProjeto" maxlength="10" > >size="10" /> > > > >Ok, the attribute "name" means that my object has the name "projeto". Itīs a > >DTO that an action class > >put in the request. > >Well, the html:text will render an input text catching the value from the > >"dtIniRealProjeto" attribute of my object > >"project". But this attribute is of Calendar type. Then, what appear in the > >browser is the instance representation of > >this calendar, no the date values. So i want to format this values before > >presentation and make the html:text show > >the formatted data. > > > >Thatīs the problem, one solution could be using the action form but if i > >have a DTO with the values, why must i have to > >copy all values back to Action Form? Donīt you thin this is time-consuming, > >cpu-consuming, memory-consuming? > > > >I think the major question is: > >How can i use the html:text to get value from an object (DTO or Action Form) > >and FORMAT it???? > > > >I have seen in the archives many questions and no real answer. > > > >Thanks > > > >Giovani Salvador > > > > > > > >----- Original Message ----- > >From: "Hubert Rabago" <[EMAIL PROTECTED]> > >To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > >Sent: Thursday, January 08, 2004 4:27 PM > >Subject: Re: html:text and converter > > > > > > > > > >>Yes, that last msg wasn't much help. Maybe if you provide a bigger > >> > >> > >picture of > > > > > >>the situation, other folks can give you alternatives. Or at least help > >> > >> > >convince > > > > > >>you of the advantages to using AFs. > >> > >>--- Hubert Rabago <[EMAIL PROTECTED]> wrote: > >> > >> > >>>Perhaps it's time to consider using AFs. :) > >>> > >>> > >>>--- Giovani Salvador <[EMAIL PROTECTED]> wrote: > >>> > >>> > >>>>The problem is that i am not showing the data with the action form. I > >>>> > >>>> > >use > > > > > >>>>the html:text to read > >>>>directly from my DTO and, unfortunatly, no conversion is made. :( > >>>> > >>>> > >>>>Giovani Salvador > >>>> > >>>> > >>>>----- Original Message ----- > >>>>From: "Hubert Rabago" <[EMAIL PROTECTED]> > >>>>To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > >>>>Sent: Thursday, January 08, 2004 3:14 PM > >>>>Subject: Re: html:text and converter > >>>> > >>>> > >>>> > >>>> > >>>>>You'll have to format the data that you're passing to your > >>>>> > >>>>> > >ActionForm. If > > > > > >>>>you're > >>>> > >>>> > >>>>>extending from ActionForm (but not using a Dyna form), perhaps you > >>>>> > >>>>> > >can > > > > > >>>>format the > >>>> > >>>> > >>>>>data in your setField() method, or before returning from a > >>>>> > >>>>> > >getField() > > > > > >>>>method. > >>>> > >>>> > >>>>>--- Giovani Salvador <[EMAIL PROTECTED]> wrote: > >>>>> > >>>>> > >>>>>>Hi all... > >>>>>> > >>>>>>Is there a way to force that html:text call a converter? My > >>>>>> > >>>>>> > >problem is > > > > > >>>>that i > >>>> > >>>> > >>>>>>am trying to format > >>>>>>a date before showing it with html:text tag and a possible way is > >>>>>> > >>>>>> > >to > > > > > >>>>pass by > >>>> > >>>> > >>>>>>the StringConverter class, > >>>>>>for example. By debugging the jakarta commons beans i perceveid > >>>>>> > >>>>>> > >that > > > > > >>>>this call > >>>> > >>>> > >>>>>>is not made. Any tip > >>>>>>on how to force passing by the StringConverter? > >>>>>> > >>>>>>Thanks. > >>>>>> > >>>>>>Giovani Salvador > >>>>>> > >>>>>> > >>>>>> > >>>__________________________________ > >>>Do you Yahoo!? > >>>Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes > >>>http://hotjobs.sweepstakes.yahoo.com/signingbonus > >>> > >>>--------------------------------------------------------------------- > >>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >>> > >>__________________________________ > >>Do you Yahoo!? > >>Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes > >>http://hotjobs.sweepstakes.yahoo.com/signingbonus > >> > >>--------------------------------------------------------------------- > >>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]