This is similar to some things we've done or thought about.
Well, at least that makes me think I'm on the right track :)
Personally, I'm a pretty big fan of using reflection to find methods (a la DispatchAction) although I do think that some folks find it less appealing.
I've always been a bit concerned about the overhead and performance implications of reflection. Certainly Struts itself shows that it's perhaps not as bad as I fear, and I would agree that you tend to get more elegant results using it. Certainly, simplifying the configuration files is a nice benefit that I'm certainly in favor of. Ok, you've convinced me :)
Of course, if you want to introspect to invoke a method, you have to have a well-defined parameter list. Here's where I think adding a "StrutsContext" object which encapsulates form, mapping, request, and response might help.
Interestingly, I just converted an application to Struts from a home-grown framework, and that's one of the concepts I actually had to do away with! Well, didn't HAVE to, I could have written my own context class to take the place of what was there, but it seemed more "proper" in light of how Struts currently is implemented to get rid of it. Just a little anecdotal thing though, I have no real point :)
More importantly, though, wouldn't you want to hang the "PrepView" configuration off of the forward config instead of the ActionMapping?
Well, now your kind of extending what I was thinking, which is good! I was thinking in terms of a failed validation returning to an input page that maybe has some drop-downs that need to be populated. I think that should be hung off the <action> tags. But, your right, what about forwarding to a page that needs prep work too? In that case, yes, the <forward> is clearly, to me anyway, the right place to put it. So, maybe that attribute should exist for both tags, in my view of things anyway.
How to implement the actual configuration is the major outstanding question in my mind before I'd be ready to try implementing it. I'd love to hear some opinions...
Maybe just to be a little more generic, you have a "PrepClass" attribute for both <action> and <forward> tags, both optional. If present, the request processor (whcih you'd have to modify obviously) would call on that class (some standard method probably?) to do the prep work. I guess you'd probably need a form bean specification for the forwards, and then instantiate to pass to the prep class but never do any validation on it. That part could be a little tricky, just to work out all the possible flows and being sure the correct form(s) are present when they need to be, etc.
Frank
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]
_________________________________________________________________
From ‘will you?’ to ‘I do,’ MSN Life Events is your resource for Getting
Married. http://lifeevents.msn.com/category.aspx?cid=married
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]