Well, if i have a DTO object (data-transfer object approach) wich is
completely according to Entity Bean. This DTO uses in diff layers of j2EE
app: in Service layer (i.e. session fasade) - for data transfering: in
Presentation layer - for data representin' .
In VIEW component of MVC model ActionForm consists of serveral such DTO
(aggregate them) - so that form look like coarse-grained object (no simple
type fields).
4xmpl
********************
class PersonDTO{
 personName : String
 personBDay : java.sql.Date;
 .....
set/getXXX
}
************************88

class form_xxx {
 PersonDTO personProfile;
 AddressDTO address;
   .............
 AnyThingElseDTO anotherData;

..
set/get_XXX
..
}
**************************
on jsp i use nested properties of beans
like <html:text property="personProfile.personName"/>
      <html:text property="personProfile.personBDaye"/>
..............

Usin' this approach i do not need to control the presence of each field of
DTO in appropriate formBean.

But the java.sql.Date breakes it all!!!.


----- Original Message -----
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, November 26, 2002 1:48 AM
Subject: Re: AW: java.sql.Date again!!


>
>
> On Mon, 25 Nov 2002, Slava_L wrote:
>
> > Date: Mon, 25 Nov 2002 19:01:26 +0800
> > From: Slava_L <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > Subject: Re: AW: java.sql.Date again!!
> >
> > But is it possible to hide DateWrapper behind java.sql.Date ? i wish to
use
> > JDBC type in my FormBean
>
> You really don't want to do that.
>
> Consider the case where your user types in an invalid date (no matter what
> particular design format you choose).  What users expect is that the input
> form will be redisplayed (with error messages), with the originally
> entered data redisplayed.  That cannot happen if the form bean property is
> a java.sql.Date.
>
> In general, if you're going to use an HTML text input field to accept
> data, the corresponding form bean property should be a String.  Do the
> conversions in the Action that receives and processes the form (the
> BeanUtils.copyProperties() method is very useful for this purpose).
>
> Craig
>
>
> --
> 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]>

Reply via email to