If the form is returned after validation, the fields should be
refilled with whatever the user submitted, unless your input somehow
causes a new request to be created. After validation, Struts has
done exactly what you did to prefill the form: instantiate a form
bean, populate properties, and place it into request or session scope
under the name associated with the validating action mapping.
Is your input somehow causing a new request to be created? This
might lead to the values being "forgotten." (A quick test of that
might be to switch the scope of the validating action mapping to
session, at least to see what happens.)
Sometimes there are other components of a form (like a select menu)
which are prepared by a prepopulation action but which are not
properly form properties, and those don't automatically get
re-established in a case like this -- is that what's happening to
you? There are a few solutions for that, but rather than clutter
this message, lets see if that is the issue or if I'm
misunderstanding you.
Joe
At 6:44 PM +0530 9/27/05, rahul wrote:
Hi all,
I need to show some prefilled value in a html form then take new inputs
from the user and save the changes.
I am doing this by prepopulating an ActionForm, putting it into request as
an Attribute
then displaying it onto the jsp.
Its working fine and the changed value are also available in next Action.
But the problem arises when some error is returned by ActionForm.validate()
method
In this case the same jsp is shown but the prepopulated values are gone.
Is there any way to keep the prepopulated values in the jsp when input jsp
is shown
due to ActionErrors returned by validate() method.
Do I need to store the prepopulated ActionForm in session instead of
request?
--RahulJoshi
--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]