struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Form not populating from post to struts.
Date Tue, 25 Mar 2003 21:04:41 GMT


On Tue, 25 Mar 2003, Simon Kelly wrote:

> Date: Tue, 25 Mar 2003 09:00:52 +0100
> From: Simon Kelly <kelly@ipe.fzk.de>
> Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> Subject: Re: Form not populating from post to struts.
>
> Ok.  Thanks for all the comments, they have been most helpful.
>
> On the point of the jsessionid, it works with or without the id there.  I
> have it in as a check for something completely different and have since
> removed it anyway.  Thanks for the comments on it though.
>
> I have found that the problem is not actually in the form bean (which is
> extending the ActionForm class), but more to do with *when* I attempt to
> access the bean.
>
> I have this situation.
>
> * The form is filled and the user submits.
> * Struts is forwarded to my ActionClass for this form.
> ---- Problem starts here ----
> * I need the information from that bean, to activate some business logic, so
> I take the form from the execute() parameter list and pass this to the
> business layer (Where it has no content!!).

What does the <action> element in struts-config.xml, for this Action, look
like?  In particular, if you don't specify a "name" attribute to identify
the relevant form bean, then Struts will assume that this Action
doesn't need a form bean, and won't create/populate one for you.

I guess it is not clear what "it has no content" really means.

> * After the business layer has finished, I put the form in the request as
> follows
>     SignalSelectForm currentForm = (SignalSelectForm)form;
>     request.setAttribute(StrutsCXConstants.CURRENTFORM, currentForm);
> and then forward it to a servlet.
> ---- Problem ends here ----
> * The servlet then gets the form using the *exact* same CURRENTFORM, and
> then processes the form in *exactly* the same way as the business layer does
> (it is the same code) but it gets the data out.
>
> Any ideas??
>
> Cheers, and thanks again for the comments,
>
> Simon
>

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message