struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon.Ridgway" <>
Subject RE: How ActionForm Populate Form Variables
Date Wed, 10 Jul 2002 09:17:23 GMT
Hi Ravi,

Your struts-config defines a mapping between action classes and forms. When
you submit a form it is posted to the ActionServlet. This uses the mapping
to work out which ActionForm to use; it then uses reflection to call the
setter methods on the ActionForm that map to the input fields on your
submitted form. So if you have a an html:text field with a property of
username the setUsername method is called and the value of the text field is
passed in as the argument. Finally the populated form is passed to the
Action class specified via the mapping in the struts-config.

Jon Ridgway

-----Original Message-----
From: Kasinath [] 
Sent: 10 February 2002 12:25
To: Struts Users Mailing List
Subject: How ActionForm Populate Form Variables

Hi All,

Can any one explain how the instance variable of ActionForm get instantiated
with posted form values. For examples I have written a LogonForm extending
ActionForm which has two variables username and password.In this regard how
action servlet will populate the instance variable of LogonForm.



The contents of this email are intended only for the named addressees and
may contain confidential and/or privileged material. If received in error
please contact UPCO on +44 (0) 113 201 0600 and then delete the entire
e-mail from your system. Unauthorised review, distribution, disclosure or
other use of this information could constitute a breach of confidence. Your
co-operation in this matter is greatly appreciated. 

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message