Well, with most of the applications I have written, all or part of the form (sometimes hidden fields) need to be populated before the form is displayed. I prefer to keep my forms fairly stupid value objects as opposed to using smart getters and setters in the ActionForm that access the back-end etc. In cases where I do not need to pre-populate then I simply route through the ForwardAction to the JSP.

Avinash Gangadharan wrote:

I have a question that I always thought of for such situations. It is
adviesd to have 2 action mappings as Bill suggests for such situations, one
that sets up the form with validate=false
And the next that handles the form POST. Why is that?.
In my ActionForm I look for a condition which tells me if the form was
posted or not  thereby avoiding two mappings.
But the question still remains.

-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow
Sent: Thursday, June 10, 2004 11:00 AM
To: [EMAIL PROTECTED]
Subject: Re: Validation of dynaActionForm too early


Set validate="false" on the Action that forwards to the JSP containing the form. Set 'validate="true"' and set 'input="/myJsp.jsp"' for the action that processes the form.


Tom Ansley wrote:


Hi all,

I am trying to use a dynaActionForm. The problem I am having is that
when a user requests an action which has a dynaActionForm attached to it the first page the user gets from the action is a page which shows all the errors that the user needs to correct.


Basically the form is being validated before the user has a chance to
enter information into the form.

How do I go about getting it so that the first time the action is called
the validate() method is not called?


Cheers

Tom



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to