Joe, After skimming through WebWork2 (dirty word, huh?) chains to help figure out Struts-Chains, I expected some blatantly obvious way to plug the chain name into the action from the get-go. After receiving email last night from Craig, I now understand I should do that myself using the optional chain name "servlet-complete-preprocess". Until I received his letter, I believe I was missing some blatant tie-in between the org.apache.commons.chain.generic.LookupCommand chain segment and the Action name or Action class. Honestly, I assumed there would be new action-mapping attributes such as chainPreProcess="chainName" and/or chainPostProcess="chainName" to automatically invoke a chain before and/or after the action invocation. I now understand I need to make my own chain, "servlet-complete-preprocess" would be a good place, to perform that analysis in some way, manner, shape, or form. If I continue down this road, I could always join the developer list and submit a webapp example. As for Struts-chains, I can clearly see the benefits for adding individual steps into chains without having to replace the whole request processor.
Regards, David -----Original Message----- From: Joe Germuska [mailto:[EMAIL PROTECTED] Sent: Saturday, October 23, 2004 12:04 PM To: Struts Users Mailing List Subject: RE: [Struts-Chain] how to use another chain for preprocessing? At 1:11 AM -0400 10/23/04, David G. Friedman wrote: >I just don't (yet) see how or where you can set an action override. Am I >supposed to add a chain called "servlet-complete-preprocess" and put my own >code in to figure out what action is being invoked and somehow which chain I >want to call next? I guess I was expecting something in the >struts-config.xml via a set-property or something that easy to suggest where >or how to chain it. I suppose this means I need more reading. Can you >suggest any links? David: There isn't a lot of existing doc for struts-chain. This will be the major task for making it the base request processor for a future version of Struts. Discussions like this will help us understand how to explain it to people! I'm not sure I understand exactly what you're trying to achieve. Do you have a case where you have significant control logic which benefits from being broken out into "sub-chains"? It would be interesting to hear some more specifics about how people are thinking of applying the chain model to Struts. In any case, it would probably be a lot of redundant work to have parallel chains that duplicate most of the logic flow in "servlet-standard", so selecting an entire chain in "servlet-complete-preprocess" may be the "wrong" place. Depends on how different your processes are. In many cases, you could just add a few commands into servlet-standard which inspect the request state contained in the chain Context and which optionally perform behavior, rather than duplicating the entire "servlet-standard" chain. Of course, you could also replicate the "set default, then identify sub-chain" type logic which happens in servlet-complete to configure a bit of branching within servlet-standard, minimizing duplication, but still providing some flexibility. It may be because I'm conditioned to solving problems within the standard Struts request processing sequence-of-events, but for my first struts-chain based app, I simply added a few commands in the main line, rather than configuring any kind of branching. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place." - Carlos Santana --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]