At 6:26 PM -0700 12/8/05, Wendy Smoak wrote:
I need help with Commons Chain and Struts in combination.  I've read
the Commons Chain docs, including the cookbook, which uses a
CommandAction in the Chain version of mailreader.

Then in Extras we have ChainAction and DispatchChainAction.  I assume
I'm supposed to use one of those instead of including a special Action
in my webapp.


I suppose you could just use the "command" (and optionally "catalog") attribute of the action mapping and not specify any "type." (Yet another way to do it!)

If you're using a Chain action, then why would you want dispatch also? Are you talking about dispatching to a chain, instead of dispatching to a method by reflection? If that's the case, you could do it using the commons-chain Lookup Command, although it might be more elegant with a command that could use an expression to determine the name of the chain to which to dispatch. (I know there's an outstanding patch for adding expression evaluation to commons-chain, but I'm still waffling on the implementation (especially if Struts Ti is going to preference OGNL to JEXL, which has been my expression language of choice, but more because I just don't have time to implement patches with proper care right now...)

For me, I haven't come up with any very compelling use cases for chaining action logic together. Somehow there never seems to be that much reusability. I guess some of the stuff that I'm pushing back into the "model" and using chains for is stuff that could be done at the controller layer in a lighter model, but I have specific use cases for triggering the behavior both from the webapp and from other processes.

In any case, I wouldn't be surprised if there isn't some cleaning up to be done in this area -- not a lot of people have set out to use chains and commands instead of actions, so there aren't a lot of "best practices" just yet. You get to discover them!

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex

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

Reply via email to