You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by St...@gbr.xerox.com on 2004/02/23 12:27:29 UTC

RE:Form creation

Hi,

Got a  query about when ActionForm is created.

In struts config I map appname/MyQueries.do URL to MyQueryAction class via
struts config.  In execute method I expected the form to exist but it is
null (I haven't submitted the form yet I know but I thought the MyQueries.do
GET would act like I'd submitted the form).  

How do I force creation of the session scoped form? Do I have to set this up
myself first time I use it? I want to do this because I have select boxes
that have default values that the form knows about and I need to get these
default values out of the form in order to run my query the 1st time.

Am I making an complete architectural howler by wanting a form to exist so I
can set up the page before I use it?  

TIA

Stu

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


RE:Form creation

Posted by Janarthan Sathiamurthy <ja...@yahoo.com>.
Hi,
 
You need to associate your form bean with the action. So that in the execute() you can cast and get back the form.
 
Regards,
Janarthan S

Stuart.Jameson@gbr.xerox.com wrote:
Hi,

Got a query about when ActionForm is created.

In struts config I map appname/MyQueries.do URL to MyQueryAction class via
struts config. In execute method I expected the form to exist but it is
null (I haven't submitted the form yet I know but I thought the MyQueries.do
GET would act like I'd submitted the form). 

How do I force creation of the session scoped form? Do I have to set this up
myself first time I use it? I want to do this because I have select boxes
that have default values that the form knows about and I need to get these
default values out of the form in order to run my query the 1st time.

Am I making an complete architectural howler by wanting a form to exist so I
can set up the page before I use it? 

TIA

Stu

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


---------------------------------
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.