I think this should work. The most likely reason I can think of for what
you're seeing is incorrect settings in your struts-config.xml file.

You might want to check the following:

1) The 'name' in your <action> must match the 'name' in your <form-bean>.
2) The 'scope' in your <action> must be specified as "session" in your case.
3) The 'type' in your <form-bean> must be set to the actual class you are
instantiating (even if Struts won't be able to instantiate one of those).
4) The attribute name under which you are storing your form bean must be the
same as the 'attribute' in your <action>, or the 'name' if you do not
specify 'attribute'.

Hope this helps.

--
Martin Cooper


----- Original Message -----
From: "Joel Shellman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 27, 2001 5:53 PM
Subject: ActionForm with no default constructor


> Is it possible to use an ActionForm with no default constructor? Can the
> form tag just get it out of my session?
>
> I want to grab the object from persistent store and put it in the
> session (on a previous page before they get to the form). Then when they
> actually access the page, the form can just grab the object out of the
> session and use it as the ActionForm object for populating, posting,
> etc.
>
> However, when I try that I get an error because it's trying to
> instantiate a new ActionForm instead of using the one I already have for
> it in the session.
>
> Any ideas on how I can get this to work? I have to use an object with no
> default constructor because it requires credentials from the session in
> order to be constructed.
>
> Thank you,
>
> Joel Shellman


Reply via email to