You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rahul Mohan <ra...@pune.tcs.co.in> on 2004/01/09 15:47:12 UTC

Using the ActionForm in the JSP

Hi everyone,

    I need to access the ActionForm properties inside the JSP code for the same window. Is there any way to do this? 

Regarding this I have some doubts about the life cycle of ActionForms....

1. When exactly is the ActionForm object instantiated? Is the ActionForm object instantiated only on submit of the corresponding form? or is it instantiated while rendering the page?

2. Also I need to set some properties to default values at instantiation of the ActionForm. Can I simply override the ActionForm constructor in my action-form? That doesnt look like a good strategy since the constructor implementation in the ActionForm does not seem to be made for overriding as it has some code in it ( its simply servlet = null ).... so is it wise to simply override it? it seems a bit over smart idea!!! :) 

Please help me out......

thank you,
rahul