You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hubert Rabago <ja...@yahoo.com> on 2004/01/08 19:14:19 UTC

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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html:text and converter

Posted by Giovani Salvador <gi...@via-rs.net>.
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" <bb...@peapod.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
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" <ja...@yahoo.com>
> >To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >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 <ja...@yahoo.com> wrote:
> >>
> >>
> >>>Perhaps it's time to consider using AFs.  :)
> >>>
> >>>
> >>>--- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> >>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >>>>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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>__________________________________
> >>Do you Yahoo!?
> >>Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> >>http://hotjobs.sweepstakes.yahoo.com/signingbonus
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html:text and converter

Posted by Brad Balmer <bb...@peapod.com>.
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" <ja...@yahoo.com>
>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>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 <ja...@yahoo.com> wrote:
>>    
>>
>>>Perhaps it's time to consider using AFs.  :)
>>>
>>>
>>>--- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
>>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>>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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>>      
>>>
>>__________________________________
>>Do you Yahoo!?
>>Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
>>http://hotjobs.sweepstakes.yahoo.com/signingbonus
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html:text and converter

Posted by Hubert Rabago <ja...@yahoo.com>.
Giovani,

Unfortunately, it's still under development.  I'll let you know once it's ready. 


Hubert

--- Giovani Salvador <gi...@via-rs.net> wrote:
> Hubert, what�s the status of this component? Is it only under development or
> are you testing it in a real application?
> Another question, once it�s finished, what about sending your component?
> 
> Thanks
> 
> Giovani Salvador
> 
> 
> ----- Original Message ----- 
> From: "Hubert Rabago" <ja...@yahoo.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, January 08, 2004 6:01 PM
> Subject: Re: html:text and converter
> 
> 
> > I'm working on a plug-in which addresses some of the concerns you have.
> The
> > plug-in is supposed to:
> >
> > 1. define dyna action forms based on your DTO without you having to create
> > <form-bean> entries in struts-config
> > 2. allow you to initialize your dyna form using values from a DTO you
> provide
> > 3. handle the formatting of the values to be shown and the parsing of the
> > formatted values upon submission
> >
> > So if your form's field closely matches your DTO, you won't have to create
> an
> > equivalent form bean, nor would you have to write code to copy properties
> from
> > one to the other, nor would you have to write code to format properties
> like
> > dates or money.  Well, for the most part anyway.  It supposed to be
> lightweight
> > (so far looking like it'll be a jar file below 50k, not that that's the
> only
> > criteria).
> >
> > Then again, it still works with form beans underneath.  You just won't
> have to
> > deal with them directly in your actions, while still being able to
> format/parse
> > the data (and validate through validator).
> >
> >
> > --- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > 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 <ja...@yahoo.com> wrote:
> > > > > Perhaps it's time to consider using AFs.  :)
> > > > >
> > > > >
> > > > > --- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> > > > > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > > > > 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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > > >
> > > >
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> > > > http://hotjobs.sweepstakes.yahoo.com/signingbonus
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> > http://hotjobs.sweepstakes.yahoo.com/signingbonus
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html:text and converter

Posted by Giovani Salvador <gi...@via-rs.net>.
Hubert, what´s the status of this component? Is it only under development or
are you testing it in a real application?
Another question, once it´s finished, what about sending your component?

Thanks

Giovani Salvador


----- Original Message ----- 
From: "Hubert Rabago" <ja...@yahoo.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, January 08, 2004 6:01 PM
Subject: Re: html:text and converter


> I'm working on a plug-in which addresses some of the concerns you have.
The
> plug-in is supposed to:
>
> 1. define dyna action forms based on your DTO without you having to create
> <form-bean> entries in struts-config
> 2. allow you to initialize your dyna form using values from a DTO you
provide
> 3. handle the formatting of the values to be shown and the parsing of the
> formatted values upon submission
>
> So if your form's field closely matches your DTO, you won't have to create
an
> equivalent form bean, nor would you have to write code to copy properties
from
> one to the other, nor would you have to write code to format properties
like
> dates or money.  Well, for the most part anyway.  It supposed to be
lightweight
> (so far looking like it'll be a jar file below 50k, not that that's the
only
> criteria).
>
> Then again, it still works with form beans underneath.  You just won't
have to
> deal with them directly in your actions, while still being able to
format/parse
> the data (and validate through validator).
>
>
> --- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > 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 <ja...@yahoo.com> wrote:
> > > > Perhaps it's time to consider using AFs.  :)
> > > >
> > > >
> > > > --- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> > > > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > > > 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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> > > http://hotjobs.sweepstakes.yahoo.com/signingbonus
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html:text and converter

Posted by Hubert Rabago <ja...@yahoo.com>.
I'm working on a plug-in which addresses some of the concerns you have.  The
plug-in is supposed to:

1. define dyna action forms based on your DTO without you having to create
<form-bean> entries in struts-config
2. allow you to initialize your dyna form using values from a DTO you provide
3. handle the formatting of the values to be shown and the parsing of the
formatted values upon submission

So if your form's field closely matches your DTO, you won't have to create an
equivalent form bean, nor would you have to write code to copy properties from
one to the other, nor would you have to write code to format properties like
dates or money.  Well, for the most part anyway.  It supposed to be lightweight
(so far looking like it'll be a jar file below 50k, not that that's the only
criteria).

Then again, it still works with form beans underneath.  You just won't have to
deal with them directly in your actions, while still being able to format/parse
the data (and validate through validator).


--- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> 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 <ja...@yahoo.com> wrote:
> > > Perhaps it's time to consider using AFs.  :)
> > >
> > >
> > > --- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> > > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > > 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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> > http://hotjobs.sweepstakes.yahoo.com/signingbonus
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html:text and converter

Posted by Giovani Salvador <gi...@via-rs.net>.
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" <ja...@yahoo.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
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 <ja...@yahoo.com> wrote:
> > Perhaps it's time to consider using AFs.  :)
> >
> >
> > --- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > 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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: html:text and converter

Posted by Mike Jasnowski <mj...@bea.com>.
I believe, the point at which commons converters are implemented in Struts
won't help you here, judging by the way you're passing data to the view.

But if all you're trying to do is format the string into a date and you have
to stick with the DTO directly to view approach, you could try a combination
of the Struts TextTag and the JSTL formatting tags?  Format the data in the
JSP with the JStL formatting tag, then pass this new value to the TextTag?

Another option is to format it in the action, and pass it thru an actionform
(as previously described)



-----Original Message-----
From: Hubert Rabago [mailto:jakartauser@yahoo.com]
Sent: Thursday, January 08, 2004 2:27 PM
To: Struts Users Mailing List
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 <ja...@yahoo.com> wrote:
> Perhaps it's time to consider using AFs.  :)
>
>
> --- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > 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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html:text and converter

Posted by Hubert Rabago <ja...@yahoo.com>.
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 <ja...@yahoo.com> wrote:
> Perhaps it's time to consider using AFs.  :)
> 
> 
> --- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > 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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html:text and converter

Posted by Hubert Rabago <ja...@yahoo.com>.
Perhaps it's time to consider using AFs.  :)


--- Giovani Salvador <gi...@via-rs.net> 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" <ja...@yahoo.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> 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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html:text and converter

Posted by Giovani Salvador <gi...@via-rs.net>.
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" <ja...@yahoo.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
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 <gi...@via-rs.net> 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: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org