Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification.
The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/EventActionDispatcher ------------------------------------------------------------------------------ == Action Dispatcher == Struts 1.2.7+ distribution includes !ActionDispatcher class that combines features of all dispatch actions. It allows to select a particular behavior or flavor and, what is the most appealing, it allows to dispatch events to any action class. - !ActionDispatcher does not improve event-handling features of the three aforementioned dispatch classes, so it has been extended. The extended version is called [http://issues.apache.org/bugzilla/attachment.cgi?id=17724 ParameterListActionDispatcher] and solves all known dispatch issues: + !ActionDispatcher does not improve event-handling features of the three aforementioned dispatch classes, so it has been extended. The extended version is called EventActionDispatcher. It is included in Struts 1.2.9 and 1.3.1+ and solves all known dispatch issues: * Any arbitrary action class can handle several events. * One action mapping can contain several event definitions. @@ -30, +30 @@ * If event is not recognized and default method is not defined, the dispatcher invokes {{{unspecified}}} method. * Standard Cancel buttons is hooked up to {{{cancelled}}} method and does not have to be defined explicitly. - == Dispatching events using ParameterListActionDispatcher == + == Dispatching events using EventActionDispatcher == Dispatching events is now easy. Usually, you will define two action classes: ''submit action'' will handle all input events , while ''setup/render action'' will choose an appropriate page and display it. In some cases you can get by with only one action that handles events as well as renders a view. @@ -53, +53 @@ import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; import org.apache.struts.actions.ActionDispatcher; - import org.apache.struts.actions.ParameterListActionDispatcher; + import org.apache.struts.actions.EventActionDispatcher; public class DispatcherSampleAction extends Action { @@ -61, +61 @@ * Instantiate event dispatcher */ protected ActionDispatcher dispatcher = - new ParameterListActionDispatcher (this, false); + new EventActionDispatcher (this, false); /** * Use event dispatcher to call an appropriate event handler. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]