tags:

views:

33

answers:

1

In struts 1.2, when an URL in the form http://foo.com/barAction.do is invoked, this will call the execute method (or process) in the action class that was mapped to barAction.

Is it possible to call a different method other than the execute (or process) in the same action class when the above URL is invoked?

A: 

You can use a DispatchAction. Basically they allow you to choose which method will be invoked based on a request parameter or action mapping configuration

There are at least 3 "flavours" of DispatchAction: EventDispatchAction, LookupDispatchAction, and MappingDispatchAction.

I'd recommend you to take a lookt at EventDispatchAction that was introduced in Struts 1.2.9.

Daniel Melo