You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ab...@aon.ca on 2004/08/03 18:19:31 UTC
Réf. : Re: ActionForm vs Hibernate POJO
Thanks a lot,
Is there any work done for OGNL integration in struts ?
Wendy Smoak <ja...@wendysmoak.com>
03/08/2004 11:57
Veuillez répondre à "Struts Users Mailing List"
Pour : Struts Users Mailing List <us...@struts.apache.org>
cc :
Objet : Re: ActionForm vs Hibernate POJO
> I am using Struts with Hibernate, and I was asked to reuse the Hibernate
> pojo as forms for my actions.
> Is it possible ?
Possible, but not advisable... at some point you will need to have
something
different in the form than in the POJO. Forms are generally all String
properties, POJO's should have types that make sense for the type of data
stored in them.
Since you can generate the code for the Form (xdoclet?) or use Dynamic
forms, the amount of effort you save by trying to reuse the Value Object
(your POJO) is IMO not worth the problems it's likely to cause.
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
______________________________________________________________________
This message has been scanned and is free of viruses./
Ce courriel a fait l'objet d'une vérification et est exempt de virus.
_____________________________________________________________________
**********************************************************************************
La présente communication (et tout fichier rattaché) s'adresse uniquement au(x) destinataire(s) précité(s) et ne peut être autrement distribuée, copiée ou utilisée. Le contenu de cette communication peut être assujetti au privilège du secret professionnel. Tout droit à ce privilège est expressément revendiqué et nullement abandonné. Si vous avez reçu cette communication par erreur, veuillez nous en avertir immédiatement en répondant à ce courriel ou en nous appelant. Veuillez également effacer cette communication (et tout fichier rattaché) sans en conserver une copie. Merci.
***************
This communication (and any attachments) is directed in confidence to the addressee(s) listed above, and may not otherwise be distributed, copied or used. The contents of this communication may also be subject to lawyer-client privilege, and all rights to that privilege are expressly claimed and not waived. If you have received this communication in error, please notify us by reply e-mail or by telephone and delete this communication (and any attachments) without making a copy. Thank you.
Re: ActionForm vs Hibernate POJO
Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: <ab...@aon.ca>
> Thanks a lot,
> Is there any work done for OGNL integration in struts ?
[Googles... Object-Graph Navigation Language; it is an expression
language for getting and setting properties of Java objects]
I'm not entirely sure what happens behind the scenes, but:
In the struts-example webapp, you'll see an example of
BeanUtils.copyProperties( ... ) being used to copy properties back and forth
from the POJO to the Form. It can handle most conversions, or you can
register a Converter if something special needs to happen.
The Form gets populated from the request by the Struts framework, so if
you're concerned about having to call all the get/set methods yourself, that
is already taken care of.
HTH,
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org