struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <andrew.david.h...@gridnode.com>
Subject RE: About prepopulating a form...
Date Wed, 18 Jun 2003 08:08:43 GMT
<snip>
The problem I have with this is that in the action
class the form has not yet been initialized (since it is before form gets
displayed and submitted, of course) and therefore is null.
</snip>

Shouldnt be.

The request processor will have instantiated your ActionForm bean for you
based on whats in the action mapping and it will be provided to your actions
execute method. Check what you have in struts-config.xml for that action.

-----Original Message-----
From: Nadja Senoucci [mailto:senoucci@21st.de]
Sent: Wednesday, 18 June 2003 15:11
To: struts-user@jakarta.apache.org
Subject: About prepopulating a form...


Hello again,

A while ago I had asked a question about how to prepopulate a form with the
data of an object in my session. I got told to do it in the action class
leading up to this form. The problem I have with this is that in the action
class the form has not yet been initialized (since it is before form gets
displayed and submitted, of course) and therefore is null. So I am back to
my originial question: How to fill the fields in my form with the data of an
object stored in a session before I call the form's validate method (and
would therefore have a request object where I could get my object out of)?

If I just create an instance of the needed form bean that would not help me
much, I assume, since I have no way of telling struts to use this instance
and not create another one...

Greetings,
Nadja



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


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


Mime
View raw message