Yeah, I have used DispatchAction in the past but found it a bit klugey.
Rather than adding the querystring parameters in the Struts config for
dispatch, I overrode the processActionPerform method in RequestDispatcher.
I forget the specifics of the way DispatchActions are handled but at the
time it seemed to make more sense that this be handled by the
RequestProcessor.

*original implementation:*
try {
   return (action.*execute*(mapping, form, request, response));
} catch (Exception e) {
   return (processException(request, response, e, form, mapping));
}

*my impelementation (more or less):*
String actionType = getActionType(mapping); //gets the suffix of the mapping
(*/select.do, */submit.do, */cancel.do)
if(actionType.equals("submit")){
   return (myBaseAction.*doSubmit*(mapping, form, req, res));
}else if(actionType.equals("cancel")){
   return (myBaseAction.*doCancel*(mapping, form, req, res));
}else if(actionType.equals("select")){
   return (myBaseAction.*doSelect*(mapping, form, req, res));
}


On 6/19/06, Rick Reumann <[EMAIL PROTECTED]> wrote:

Monkeyden wrote:

> I don't use the execute() method of Action at all and have implemented a
> separate abstract doCancel method in my base action, which cleans up any
> unecessary state, but this requires an extension of the struts/tiles
> request
> processor.

I find it easier just to use an html:submit value="Cancel" but have it
call your dispatch method called "cancel" and do whatever you need to do
there. (I do the same thing for reset and since I call validation
manually I don't have to worry about the validation framework being
called since I won't call it from my 'reset' or 'cancel' methods).

--
Rick


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


Reply via email to