My preference is to emulate the session functionality in your own classes,
i.e. publish / subscribe.  Stick a static map in your class and use a unique
key generated from objects both threads are aware of to index the object,
then you can pull it out when you need to.  Synchronize if you need to as
well.

I like this better because then you can run junit tests w/o worring about
the container.

Edgar

> -----Original Message-----
> From: Shyam A [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, October 14, 2003 8:39 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: Passing parameters between forms
> 
> 
> Carey,
> 
> Thanks for your mail. I knew about the option you
> suggested and mentioned it in my mail.
> 
> quote:
> 
> I know I can save the "foo" attribute into session in
> Action A class and access it in Action B, or set the
> scope of Form A to session in struts-config and access
> Form A from Action B.
> 
> unquote:
> 
> However, the disadvantage of this option is that I
> need to use session scope for the forms, which I would
> like to avoid.
> 
> I also know it is possible to pass the form attribute
> as a request parameter as follows:
> 
> <html:link page="Action B?parameter=value">
> 
> But, this allows the user to see the parameters being
> passed. I would rather use buttons for the link and
> post the form.
> 
> Do you have any suggestions/comments?
> 
> Thanks,
> Shyam
> 
> 
> --- Carey Nation <[EMAIL PROTECTED]> wrote:
> > I have some vague memory (perhaps completely wrong)
> > that the forms are
> > stored wherever they are stored using the names that
> > you specify in
> > struts-config.  It may not be the nicest way to do
> > this, but I'm pretty sure
> > that, given session scope on your forms, you can do
> > something like
> > (FormA)forma = session.getAttribute("FormA");
> > 
> > HTH,
> > Carey
> > 
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search 
http://shopping.yahoo.com

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

Reply via email to