You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nishant Deshpande <ni...@gmail.com> on 2005/10/06 21:42:44 UTC

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?

Posted by Nishant Deshpande <ni...@gmail.com>.
ok got it

thanks


On 10/6/05, Dave Newton <ne...@pingsite.com> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: ActionForm validate() - what Action does the controller call?

Posted by Dave Newton <ne...@pingsite.com>.
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ActionForm validate() - what Action does the controller call?

Posted by Michael Jouravlev <jm...@gmail.com>.
On 10/6/05, Nishant Deshpande <ni...@gmail.com> 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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ActionForm validate() - what Action does the controller call?

Posted by Dave Newton <ne...@pingsite.com>.
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ActionForm validate() - what Action does the controller call?

Posted by ra...@tcs.com.
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" <us...@struts.apache.org>


To
Struts Users Mailing List <us...@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:NT0000591E 


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