On Tue, 23 Nov 2004 14:20:02 -0600, Joe Germuska <[EMAIL PROTECTED]> wrote: > > > >I need to have a hook into processValidate() on validation failure. > > > >Currently that can only be done by copy-and-pasting the processValidate() > >method from RequestProcessor into a subclass and sticking a hook into the > >middle of the code. > > > >When I asked about this on the dev list long ago, it was confirmed that > >there was no other way to do this, but that chain would eventually provide > >this flexibility. > > > >If the chain isn't configured at a fine-grain level, then it's not all that > >much more functional than the existing RequestProcessor. > > The chain is configured at as fine-grained a level as you like, in > XML. Hubert is talking about configuring the chain programatically > as well, or at least in some way independent of the configuration of > the primary processing chain. >
Programmatic configuration is certainly feasible ... there's no requirement in [chain] that you use the XML format at all. It's just one option. > As long as you're willing to copy the base chain-config.xml file and > make a few modifications, then you could simply add your own command > which retrieves a value from the context under a well-known key and > inspects the value to see if validation passed or not. This exact > logic is the first thing executed in the CreateAction's execute > method, which doesn't lookup or create an action unless the form > validated. > There's actually quite a few different ways to approach this, including the "optionally invoke some other command at this point" mentioned earlier in the thread, so you don't even *have* to cut-n-paste the standard version of the chain. > You can start experimenting with commons-chain and struts-chain from > CVS Head if you want to see what's going on. You don't have to wait > for Struts 1.3. Indeed, Struts-Chain directly illustrates the fine-grained approach to defining the standard request processing chain that Joe describes. Nightly builds are available at: http://cvs.apache.org/builds/jakarta-struts/nightly/struts-chain/ > > Joe > Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]