You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Frank Ling <fe...@hotmail.com> on 2001/03/20 23:42:57 UTC
Can't access ActionForm properties in Action perform()!
Hi, There:
I have some question regarding access the actionform, I have two Actions, one is "edit" and one is "save", they both share the same form just like struts-example, when I do the edit, the form is access fun, but when I do the save, the ActionForm is not null, but content in form is null, I am really no sure is the scope problem or something else.
If anybody have similar problem before, please give some help.
Thanks in advance.
Regards
Frank Ling
Re: Can't access ActionForm properties in Action perform()!
Posted by Frank Ling <st...@hotmail.com>.
HI, Craig:
Thank you very much for your quick reply, but I did exactlly like example.
here is related info for my struts-config.xml.
<!--Statement form bean-->
<form-bean name="statementForm" type="com.ingenuity.app.apt.StatementForm"/>
</form-beans>
<!--Display Statement-->
<action path="/displayStm"
type="com.ingenuity.app.apt.DisplayStmAction" name="statementForm"
scope="request" validate="false">
<forward name="success" path="/displayStm.jsp"/>
</action>
<!--Save Statement-->
<action path="/saveStm" type="com.ingenuity.app.apt.SaveStmAction"
name="statementForm" scope="request" input="/displayStm.jsp">
<forward name="success" path="/displayStm.jsp"/>
</action>
I did have name and scope be the same, but some how still give me error.
Thanks.
Frank Ling
----- Original Message -----
From: Craig R. McClanahan <cr...@apache.org>
To: <st...@jakarta.apache.org>
Sent: Tuesday, March 20, 2001 2:53 PM
Subject: Re: Can't access ActionForm properties in Action perform()!
>
>
> On Tue, 20 Mar 2001, Frank Ling wrote:
>
> > Hi, There:
> >
> > I have some question regarding access the actionform, I have two
Actions, one is "edit" and one is "save", they both share the same form just
like struts-example, when I do the edit, the form is access fun, but when I
do the save, the ActionForm is not null, but content in form is null, I am
really no sure is the scope problem or something else.
> >
>
> Make sure that you've declared your dependence on the form bean in *both*
> entries in struts-config.xml (using the same bean name and scope), as the
> example does:
>
> <action path="/editRegistration"
> ...
> name="registrationForm"
> scope="request"
> ...
> />
>
> <action path="/saveRegistration"
> ...
> name="registrationForm"
> scope="request"
> ...
> />
>
> > If anybody have similar problem before, please give some help.
> >
> > Thanks in advance.
> >
> > Regards
> >
> > Frank Ling
> >
>
> Craig
>
>
>
Re: Can't access ActionForm properties in Action perform()!
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Tue, 20 Mar 2001, Frank Ling wrote:
> Hi, There:
>
> I have some question regarding access the actionform, I have two Actions, one is "edit" and one is "save", they both share the same form just like struts-example, when I do the edit, the form is access fun, but when I do the save, the ActionForm is not null, but content in form is null, I am really no sure is the scope problem or something else.
>
Make sure that you've declared your dependence on the form bean in *both*
entries in struts-config.xml (using the same bean name and scope), as the
example does:
<action path="/editRegistration"
...
name="registrationForm"
scope="request"
...
/>
<action path="/saveRegistration"
...
name="registrationForm"
scope="request"
...
/>
> If anybody have similar problem before, please give some help.
>
> Thanks in advance.
>
> Regards
>
> Frank Ling
>
Craig