struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Jouravlev" <jmi...@gmail.com>
Subject Re: Buttons and DispatchActions
Date Wed, 22 Feb 2006 19:05:08 GMT
On 2/22/06, Fali <maillist@roomity.com> wrote:
<snip>
> Moosbauer, I use MappingDispatchActions and they work fine for me. I enter the name of
the method in the actual Action definition in the struts-config.xml using the attribute called
"parameter" ... ... Once in the mapped method, I know what button of the form that was clicked
by the user because I have added an entry in my DynaForm to collect it.
</snip>

Why do you need an entry in the form if you are already in the proper method?

<snip>
data property... date property I have set up my buttons in this shape:
Later, in my function, I know what button was pressed because the
pressed one will return a non null value when I get it from the form
String submitReturnValue = form.get("_submitform") String
revertReturnValue = form.get("_revertform") This might be a different
approach than the one that originally you are taking, but I hope that
it will work for you..... Fali
</snip>

What is this for, if you already has been taken to a proper method?

MappingDispatchAction allows to specify only one method in "parameter"
attribute, therefore you need as many mappings in struts-config.xml
file as many methods you want to map. I don't see this as a benefit.

ParameterListActionDispatcher that I referred to in my previous email
is better because it allows to define a whole bunch of methods in a
single mapping. Also, your action class does not need to extend a
specific dispatch action to use dispatch services.

I use ParameterListActionDispatcher and it rules!

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message