Re: Data type handling

2002-05-31 Thread Ted Husted

ActionForms are not data beans and are really not intended to handle any
binary types at all, native or not. 

Once the ActionForm is validated, it can be transfered to a data bean
that uses binary types. 

For native types, you can use BeanUtils again. But for other types, you
need to manage the conversion in another way. 

I put *Display properties on my data transfer objects that handle
converting the incoming strings to native types and vice-versa. This is
not just a Struts issue, but applies to any platform that expects data
in Strings. 

This gives you a chance to resolve Locale and other formatting issues
that  may exist between the presentation and business layer. 

For more see, 

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg19281.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg19338.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg20833.html

Will Spies/Towers Perrin wrote:
> 
> I'll try asking you directly. This question that easy? Seems
> BeanUtils.populate can't do this. Do you know of any utilities that can?
> 
> Thanks for any help!
> ___
> Will Spies
> Towers Perrin
> Phone: (215)246-7145
> e-mail: [EMAIL PROTECTED]
> - Forwarded by Will Spies/Towers Perrin on 05/31/02 02:58 PM -
> 
> 
>To:   "Struts Users Mailing List" 
><[EMAIL PROTECTED]>
>   Will Spies/Towerscc:   (bcc: Will Spies/Towers 
>Perrin)
>   Perrin@TPSubject:  Re: Data type handling
> 
>   05/31/02 07:26 AM
>   Please respond to
>   "Struts Users
>   Mailing List"
> 
> 
> 
> It may be that this is a newbie question but I can't seem to find any help
> via the archives ( yes, I tried there first ) and the documentation seems
> to suggest that all ActionForm fields are Strings.
> 
> Can anyone point me to a solution here? I can't believe I'm the first to
> hit this so I'm convinced it's a newbie question. We have typically only
> used strings ujtil now in our Actionforms so we have not hit this before.
> We now have a need to mix up types to reuse some of our serializable
> classes.
> 
> Thanks in advance for any help,
> 
> ___
> Will Spies
> Towers Perrin
> Phone: (215)246-7145
> e-mail: [EMAIL PROTECTED]
> - Forwarded by Will Spies/Towers Perrin on 05/31/02 07:23 AM -
> 
>To:   "Struts Users
> Mailing List" <[EMAIL PROTECTED]>
>   Will Spies/Towerscc:   (bcc: Will
> Spies/Towers Perrin)
>   Perrin@TPSubject:  Re: Data type
> handling
> 
>   05/30/02 07:44 AM
> 
>   Please respond to
> 
>   "Struts Users
> 
>   Mailing List"
> 
> We have cases where some of our data elements in our ActionForms are not
> native Java types. We have Date and Timestamp elements. Seems struts does
> not handle these data types as part of the conversion from a post to an
> ActionForm? Also, we would prefer to be able to post a Double value contain
> commas ( e.g. 37,000.34 ) as opposed to to having no commas ( e.g.
> 37000.34 works fine ).
> 
> Any suggestions?
> 
> ___
> Will Spies
> Towers Perrin
> Phone: (215)246-7145
> e-mail: [EMAIL PROTECTED]
>

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




Re: Data type handling

2002-05-31 Thread Will Spies/Towers Perrin


It may be that this is a newbie question but I can't seem to find any help
via the archives ( yes, I tried there first ) and the documentation seems
to suggest that all ActionForm fields are Strings.

Can anyone point me to a solution here? I can't believe I'm the first to
hit this so I'm convinced it's a newbie question. We have typically only
used strings ujtil now in our Actionforms so we have not hit this before.
We now have a need to mix up types to reuse some of our serializable
classes.

Thanks in advance for any help,


___
Will Spies
Towers Perrin
Phone: (215)246-7145
e-mail: [EMAIL PROTECTED]
- Forwarded by Will Spies/Towers Perrin on 05/31/02 07:23 AM -
   

   

   To:   "Struts Users Mailing List" 
<[EMAIL PROTECTED]>  
  Will Spies/Towerscc:   (bcc: Will Spies/Towers 
Perrin)   
  Perrin@TP    Subject:  Re: Data type handling

   

  05/30/02 07:44 AM

  Please respond to

  "Struts Users

  Mailing List"

   

   





We have cases where some of our data elements in our ActionForms are not
native Java types. We have Date and Timestamp elements. Seems struts does
not handle these data types as part of the conversion from a post to an
ActionForm? Also, we would prefer to be able to post a Double value contain
commas ( e.g. 37,000.34 ) as opposed to to having no commas ( e.g.
37000.34 works fine ).

Any suggestions?


___
Will Spies
Towers Perrin
Phone: (215)246-7145
e-mail: [EMAIL PROTECTED]


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






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





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




Re: Data type handling

2002-05-30 Thread Will Spies/Towers Perrin




I meant 'commas' not 'commands'. sorry bout that.

___
Will Spies
Towers Perrin
Phone: (215)246-7145
e-mail: [EMAIL PROTECTED]


   

   

   To:   
"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>   
  Will Spies/Towerscc:   (bcc: Will Spies/Towers 
Perrin)   
      Perrin@TPSubject:  Data type handling

   

  05/29/02 05:09 PM

  Please respond to

  "Struts Users

  Mailing List"

   

   







We have cases where some of our data elements in our ActionForms are not
native Java types. We have Date and Timestamp elements. Seems struts does
not handle these data types as part of the conversion from a post to an
ActionForm? Also, we would prefer to be able to post a Double value contain
commands ( e.g. 37,000.34 ) as opposed to to having no commands ( e.g.
37000.34 works fine ).

Any suggestions?


___
Will Spies
Towers Perrin
Phone: (215)246-7145
e-mail: [EMAIL PROTECTED]


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






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




Data type handling

2002-05-29 Thread Will Spies/Towers Perrin



We have cases where some of our data elements in our ActionForms are not
native Java types. We have Date and Timestamp elements. Seems struts does
not handle these data types as part of the conversion from a post to an
ActionForm? Also, we would prefer to be able to post a Double value contain
commands ( e.g. 37,000.34 ) as opposed to to having no commands ( e.g.
37000.34 works fine ).

Any suggestions?


___
Will Spies
Towers Perrin
Phone: (215)246-7145
e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: