Hi,

I would like to know is there any class in struts 2 which is equivalent to
EventDispatchAction?
So that I can convert the following:
    <action path="/sample_add" parameter="insert, default=showForm" ...>
to something like this:
    <action name="sample_add" method="insert, default=showForm" ...>

and struts 2 will call the method showForm() by default and call insert()
when button is clicked.

Currently I have to dispatch the method inside my action class if I
maintaining the same action name.

    public String execute() throws Exception {
        if (insert) {
            return insert();
        } else {
            return showForm();
        }
    }

or slip the mapping into 2 actions:
    <action name="sample_add1" method="showForm" ...>
    ...
    <action name="sample_add2" method="insert" ...>

Regards,
Boon Leng


Laurie Harper wrote:
> 
> What do you specifically need help with? Struts2 supports wildcard 
> action paths, dispatch to different methods in an action and 
> parameterized results (equivalent to the forwards in your S1 config). Is 
> there something in particular you're having trouble with?
> 
> L.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Migrate-Struts-1-EventDispatchAction-to-Struts-2-tf4074633.html#a11591032
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to