Hi Nicolas and Andrew,

Thanks for the two mails.

Here is what I do in the Action class

[code]
<!-- I get the form from the execute() parameter list -->
SignalSelectForm currentForm = (SignalSelectForm) form;

<!-- Some other bits I need that were set when the user logged into the
site -->
String uri = (String)session.getAttribute(KatrinConstants.DATABASE_URI);
String name = (String)session.getAttribute(KatrinConstants.USER_NAME_TAG);
String passwd =
(String)session.getAttribute(KatrinConstants.USER_PASSWD_TAG);
Document dbstruct =
(Document)session.getAttribute(KatrinConstants.DB_TABLES_DATA);

<!-- I put the form into the request like I would normally do -->
 request.setAttribute(StrutsCXConstants.CURRENTFORM, currentForm);

<!-- This is the business logic section I use to extract the form info.
        The code in here is identical to the code in the servlet. -->
RequestSignalsDelegate rsd = new RequestSignalsDelegate();
<!-- Here is where I first try to use the form data
        I am sending the request as I know it should
        be in here. -->
ArrayList signalVOs = rsd.createSubsystemList(request);
SignalSelectXML ssxml = new SignalSelectXML();
Document results = ssxml.getSignalData(uri, name, passwd, signalVOs,
dbstruct);

request.setAttribute(StrutsCXConstants.XML_KEY, results);
request.setAttribute(StrutsCXConstants.XSL_KEY, xslfile);
request.setAttribute(StrutsCXConstants.XML_DEBUG_PARAM,
StrutsCXConstants.TRUE);

return mapping.findForward(StrutsCXConstants.FORWARD_SUCCESS);
[code]

The servlet it forwards to is a bit big, so I've not included it. But the
code in the servlet to extract the form information, is identical to the one
in the RequestSignalsDelegate and it removes the form from the request in
the same way as well.

Thanks again for your help.

Cheers

Simon


----- Original Message -----
From: "Andrew Hill" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, March 25, 2003 12:17 PM
Subject: RE: At what point in the cycle does struts fill out the ActionForm


> Very strange.
> The request processor will populate the actionForm *before* it calls your
> actions execute method so that you can make use of the info when doing
stuff
> in your action.
> If you hadnt specified things correctly in struts config then of course it
> would be no surprise that the data isnt there - except that you DO have
data
> when you get to the servlet you forward to after the action - which kind
of
> begs the question where is that data coming from? - it is a servlet and
not
> another action you forward to right?
>
>
> -----Original Message-----
> From: Simon Kelly [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 25 March 2003 18:59
> To: Struts Users Mailing List
> Subject: At what point in the cycle does struts fill out the ActionForm
>
>
> Hi all,
>
> Still having problems with this.  I've read the books inside out and back
to
> front, but I still am unsure where in the process cycle struts fills in
the
> ActionForm.  I am accessing the form in two places, firstly in the
> associated Action class that the form submit button directs the post to.
> And then in the servlet that I forward to at the end of the said Action.
>
> Now I am using the identical code to access the bean each time.  There is
> data in the one in the servlet, but not when I access it in the action
> class. Is it during the forward when the data is loaded??
>
> Cheers
>
> Simon
>
> Institut fuer
> Prozessdatenverarbeitung
> und Elektronik,
> Forschungszentrum Karlsruhe GmbH,
> Postfach 3640,
> D-76021 Karlsruhe,
> Germany.
>
> Tel: (+49)/7247 82-4042
> E-mail : [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> 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]
>
>


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

Reply via email to