G
grz01
Have a Struts/EJB question...
If I have a web-form backed by an ActionForm in Struts, where the user
types in a record that maps directly to an EJB3 entity class and a
corresponding db-table, is it advisable (or even possible) to somehow
use the same class for the ActionForm and the EJB?
Im thinking the 2 beans, they have basically the same setter/getter
methods,
but the form-bean extends ActionForm, while the Entity class
implements serializable...
Is it possible to use one and the same class for both purposes... or
maybe one extends the other...
Or should they just be two different classes, and have to copy data
back and forth between them?
What is "best practice" here?
If I have a web-form backed by an ActionForm in Struts, where the user
types in a record that maps directly to an EJB3 entity class and a
corresponding db-table, is it advisable (or even possible) to somehow
use the same class for the ActionForm and the EJB?
Im thinking the 2 beans, they have basically the same setter/getter
methods,
but the form-bean extends ActionForm, while the Entity class
implements serializable...
Is it possible to use one and the same class for both purposes... or
maybe one extends the other...
Or should they just be two different classes, and have to copy data
back and forth between them?
What is "best practice" here?