Thanks Wendy, Mark,

of course the session.getAttribute() works well, and i used it with success
in my application.
But what would you do if you don't want to use session ?
I suppose creating a new instance of BeanB would loose its data. Using
JDNI's context lookup looks like overkill.
The other idea to regroup in one bean multiple beans is good, but would that
be possible if the two beans extends two different interfaces (ActionForm
and ValidatorForm) ?

Regards,
ERic


----- Original Message -----
From: "Wendy Smoak" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, January 13, 2004 8:02 PM
Subject: RE: Multiple Beans one Action


> From: Eric C [mailto:[EMAIL PROTECTED]
> suppose I have 2 beans one beanA extends Action Form, the other beanB
> extends ValidatorForm. I have one Action class which needs
> data from both
> beans. How can I do that ?

AFAIK Struts is only going to populate one Form bean from one request.
But if your forms are session scoped you can retrieve any of them in the
Action code with session.getAttribute().

Not knowing a thing about your design, is it possible that this is one
of those apps that would benefit from having a single big Form bean with
all the properties, and then each HTML form may only use a subset?

--
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management

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



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

Reply via email to