You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Rick Reumann <r...@reumann.net> on 2004/09/17 20:12:11 UTC
Regular Action? Re: DispatchAction
Rick Reumann wrote the following on 9/17/2004 11:03 AM:
> The main reason I like the use of a DispatchAction
> is in regard to situations where you have multiple buttons on a form.
You know, the more I think about I think I might just go back to using
reular ActionForms and not even bother with any of the Dispatch types.
For cases where I would have a few extra buttons that would behave
differently, I could just check that parameter in the execute method. I
know this ends up being a dispatch of sorts, but to me it won't be
'that' bad since 1) I usually don't have that many situations where
there are a lot of extra buttons on a form and 2) So what if it acts
like a dispatch action? It's only a few extra lines of code creating the
if/else checks for the parameter name (Or I can do one check for that
dispatch paramater name and if exists just execute that ActionDispatcher
class that Niall created ).
I'm still curious on other approaches concerning mutliple buttons that
submit a form (that don't involve use of a Dispatch flavor).
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Regular Action? Re: DispatchAction
Posted by Rick Reumann <r...@reumann.net>.
Sorry to clug the dev list with this, but since the topic started here,
I'll continue. What about this approach that when enable the use of
regular Actions and would handle the multiple button problem
I like the concept of using single Actions since it isolates what you
are doing in a single class (vs a method in a class). What I was
thinking is in the cases where you needed to use multipe buttons on a
form you could simple create an Action that would handle this request
and call the appropriate Action. For example, you have yoru typical
UserUpdateAction, UserDeleteAction etc., but then you might have a
UserMultipleActionHandler that would call one of the above Actions based
on a param. The benefit to this your regular Actions remain independent
and can be used as normal. You'd only need the handler when you have
multiple buttons submitting the form.
Uggh the whole problem with all of this is it seems like I'm going
backwards:) In other words, my first MVC app had one controller servlet
and simple Command objects that would be called (which would return a
foward param). When you think about it, that's all Actions really are
(but with a handle to the Request/Response).
Rick Reumann wrote the following on 9/17/2004 2:12 PM:
> Rick Reumann wrote the following on 9/17/2004 11:03 AM:
>
>> The main reason I like the use of a DispatchAction is in regard to
>> situations where you have multiple buttons on a form.
>
>
>
> You know, the more I think about I think I might just go back to using
> reular ActionForms and not even bother with any of the Dispatch types.
> For cases where I would have a few extra buttons that would behave
> differently, I could just check that parameter in the execute method. I
> know this ends up being a dispatch of sorts, but to me it won't be
> 'that' bad since 1) I usually don't have that many situations where
> there are a lot of extra buttons on a form and 2) So what if it acts
> like a dispatch action? It's only a few extra lines of code creating the
> if/else checks for the parameter name (Or I can do one check for that
> dispatch paramater name and if exists just execute that ActionDispatcher
> class that Niall created ).
>
> I'm still curious on other approaches concerning mutliple buttons that
> submit a form (that don't involve use of a Dispatch flavor).
>
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org