I understand what you say...my DTO model is too complex, i know. Well, i
will have to consider these things...

thanks

Giovani Salvador


----- Original Message ----- 
From: "Hookom, Jacob" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, January 08, 2004 5:28 PM
Subject: RE: html:text and converter


Isn't this issue resolved by using ActionForms correctly in the first place?
They are meant to save/transport form state, which is composed of strings.

When you want to represent form properties as Dates, Integers, etc, you may
start running into issues.  So if you have a DTO from a bean in the business
model and want to pre-populate a form object, putting the Date object itself
on the ActionForm would be incorrect IMHO.  Instead, format the date object
as a string and set that on the ActionForm.

Basically having properties of anything but String or String[] seems silly
in my opinion.  Object attributes (Date, Integer, Long) should be left
within the Action and Business layer DTO's.  Again, since ActionForm objects
represent UI data, they should be left as a String-- unless there's an html
input type of 'java.util.Date'.

-Jake



-----Original Message-----
From: Giovani Salvador [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 3:20 PM
To: Struts Users Mailing List
Subject: Re: html:text and converter

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]

Reply via email to