Right, the flow returns to the "input" page, which can be another action 
call. So I'm making my "input" point to "/myAction.do?method=myMethod", 
which calls a particular method of a DispatchAction.

It seems to work, but this kind of points to a larger question. Say I 
have some steps that need to be taken before displaying a form. For 
example, I might need to prepare the values in a drop-down menu.

If the user submits the form and the Struts validation fails, it will 
re-display the form, so I'll need to run this prep method again. This 
means I'll need to point the input parameter to an action (or a method 
of a DispatchAction).

As a result, for every form, I'm going to need two action-mappings 
defined in the struts-config file. One has validate="true", and its 
"input" points to the other action. That one has validate="false", and 
it simply prepares the form for display.

Is this right? I would expect Struts to handle this a little more 
elegantly.

Jacob



In article 
<[EMAIL PROTECTED]>,
 "Wang, Yuanbo" <[EMAIL PROTECTED]> wrote:

> Correct me if I am wrong, I don't know if this is ever possible. If the
> validation method in ActionForm class returns a not null ActionErrors
> obj, the flow will direct to "input" page, so if you really want to
> invoke something in this case, my bet is that you have to put that logic
> inside your ActionForm.validate method?
> 
> Any idea?
> 
> Thanks,
> Yuanbo
> 
> 
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of GMaine
> Sent: Friday, May 14, 2004 12:31 PM
> To: [EMAIL PROTECTED]
> Subject: Using DispatchActions with validation
> 
> 
> I have a DispatchAction with two methods. I pass a hidden field "method"
> in my form, to determine which method should be called. But I want to
> override this and call a specific method if the form's validation fails.
> 
> Is it legitimate to put this in the action mapping?
>     input="/myAction.do?method=myMethod"
> 
> Or could this conflict with the "method" hidden field?
> 
> Jacob


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

Reply via email to