Well it is also allowed to produce the output in the Action. Maybe it would be easier 
to call Pajes from the Action, stream the result into the response.out and return a 
"null"-ActionForward.

hth
Alexander

-----Original Message-----
From: Hubert Rabago [mailto:[EMAIL PROTECTED]
Sent: Mittwoch, 4. Februar 2004 18:13
To: Struts Users Mailing List
Subject: RE: Accessing ActionForm from Servlet (was: Pajes + Struts)


Hi Fred(d)y,

> (3) Despite 1 and 2, there must be a method to obtain the ActionForm(s)
> associated to an Action (during an specific request / post). Right?

I think this question has been answered twice in this very thread, once by
me, and again (and with code) by Andrew Hill.  

>From Andrew's response, with some editing:
String scope = mapping.getScope(); 
String attribute = mapping.getAttribute(); 
ActionForm yourForm = null;
if ("request".equals(scope)) {
    yourForm = (ActionForm) request.getAttribute(attribute);
} else {
    yourForm = (ActionForm) request.getSession().getAttribute(attribute);
}

If you don't want to pass around the mapping, then you'll need to know the
attribute under which the form is kept, and that defaults to the form's name
as declared in the <form-bean> declaration.  Also, you've indicated you want
the form in request scope, so you can go straight to checking the request
attributes.

--- "Villalba Arias, Fredy [BILBOMATICA]" <[EMAIL PROTECTED]> wrote:
> Hi </thorsten>
> 
> I don't know for sure. That's why I asked if I was right... :)
> 
> Anyway:
> 
> (1) How do you associate 2 ActionForms to the same Action (and have
> them automatically associated and populated by Struts)?
> 
> (2) Assuming 1 is possible (I'd really appreciate if you could explain
> me how to acomplish that), what sense does it make to have 2 ActionForms
> variables if only one form can be submitted at a time anyways? (maybe
> I'm missing something else)
> 
> (3) Despite 1 and 2, there must be a method to obtain the ActionForm(s)
> associated to an Action (during an specific request / post). Right?
> 
> Regards,
> Freddy.
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

---------------------------------------------------------------------
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