Re: ActionForm validate() - what Action does the controller call?
If the validate method returs non empty ActionErrors object, the control will go to the JSP specified in the input attribute of the corresponding action element in struts-config.xml . Thanks, Rajasekhar Cherukuri Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject ActionForm validate() - what Action does the controller call? When my ActionForm returns a non-empty ActionErrors object, where does control go to? i.e. i read from the struts site: When the properties of this bean have been populated, but before the executemethod of the Action is called, this bean's validate method will be called, which gives the bean a chance to verify that the properties submitted by the user are correct and valid. If this method finds problems, it returns an error messages object that encapsulates those problems, and the controller servlet will return control to the corresponding input form. Otherwise, the validatemethod returns null, indicating that everything is acceptable and the corresponding Action.execute method should be called. (my bold) I guess I don't understand what 'corresponding input form' means? Presumably the controller needs to call some Action, how do I know / specify which one? Thanks ForwardSourceID:NT591E Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
ActionForm validate() - what Action does the controller call?
When my ActionForm returns a non-empty ActionErrors object, where does control go to? i.e. i read from the struts site: When the properties of this bean have been populated, but before the executemethod of the Action is called, this bean's validate method will be called, which gives the bean a chance to verify that the properties submitted by the user are correct and valid. If this method finds problems, it returns an error messages object that encapsulates those problems, and the controller servlet will return control to the corresponding input form. Otherwise, the validatemethod returns null, indicating that everything is acceptable and the corresponding Action.execute method should be called. (my bold) I guess I don't understand what 'corresponding input form' means? Presumably the controller needs to call some Action, how do I know / specify which one? Thanks
Re: ActionForm validate() - what Action does the controller call?
Nishant Deshpande wrote: I guess I don't understand what 'corresponding input form' means? Presumably the controller needs to call some Action, how do I know / specify which one? The action that called the validation is executed with a GET request. (More or less.) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionForm validate() - what Action does the controller call?
On 10/6/05, Nishant Deshpande [EMAIL PROTECTED] wrote: When my ActionForm returns a non-empty ActionErrors object, where does control go to? I guess I don't understand what 'corresponding input form' means? Presumably the controller needs to call some Action, how do I know / specify which one? action element has input attribute, which contains path, where browser will be forwarded if validate() returns non-null non-empty collection. Usually it is the same page that you just submitted. Action's execute() method is not called at all. Because the control is forwarded by default, then when you refresh the page where you forwarded to, your prior invalid input is submitted again. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionForm validate() - what Action does the controller call?
Michael Jouravlev wrote: action element has input attribute, which contains path, where browser will be forwarded if validate() returns non-null non-empty collection. Usually it is the same page that you just submitted. Action's execute() method is not called at all. That's what I meant. I have allergies today. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionForm validate() - what Action does the controller call?
ok got it thanks On 10/6/05, Dave Newton [EMAIL PROTECTED] wrote: Michael Jouravlev wrote: action element has input attribute, which contains path, where browser will be forwarded if validate() returns non-null non-empty collection. Usually it is the same page that you just submitted. Action's execute() method is not called at all. That's what I meant. I have allergies today. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]