On Thu, 19 Jul 2001, Martin, Margaret wrote:

> in your action code you can retrieve it from the ActionMapping passed in to
> the perform method via:
> mapping.getParameter();
> 
> We are using this parameter to indicate the method name to invoke from
> perform, so that we have a handful of action classes with many methods on
> them rather than a lot of very thin action classes. 
> 

For the particular case of dispatching to a method (so you can combine
lots of similar things into the same Action class), you can also check out
the "standard action" that does exactly this:

  org.apache.struts.actions.DispatchAction

The Javadocs for this class include an example of how to use it.  This
class uses the "parameter" attribute slightly differently than Margaret
does -- it names the request parameter that will contain the name of the
method to be called.  It's quite convenient to include the method name as
a hidden field on an input form.

> good luck -
> Margaret

Craig McClanahan

Reply via email to