See http://jakarta.apache.org/struts/api-1.0/org/apache/struts/actions/DispatchAction.html
Really should mention this in the User Guide someplace =:0) -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ [EMAIL PROTECTED] wrote: > > I'm just trying to catch up with what's changed in struts 1.0.1 / 1.1 > from the version I previously used (pre version numbers). Is there a > facility to map a request to different methods / actions based on a > request parameter? > > For example, if the request contains a parameter "function", can I > choose the Action that will be invoked, or alternatively, can I invoke > different methods in the action defined in the form.action URL, based > on some parameter? I realise I can change the URL using javascript on > the html form, but this removes the struts config as the control of app > flow. In my previous apps, we found theat often you end up writing > Action classes similar to: > > myAction(..) extends Action { > > if (null == function) { doView(..) } > else if ("submit".equals(function)) { doSubmit(..) } > else ... > > prepareRequest(req, ..); > return mainPageForward; > } > > etc > > Which makes the action into a type of mini controller. I know this > could be done in a more OO way, but that's not my point, I'd like the > controller to be able to do this in some way. Turbine does this in a > very similar way (though I'm not sure I like their parameter > convention). > > My only issue with doing this in the main ActionServlet is that > partioning of the logic should perhaps be encapsulated better -- though > the XML config file provides a suitable scoping for this information. > > I've not been keeping up with the nightly developments - does the > "multiple applications", stuff allow this kind of thing? > > Ken. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>