Ted once suggested to add a 'FrontController'. That class could be optionally plugged into the action mapping, and would do the view preparation.
This is an idea I've been poking at and talking about for quite some time, but I am getting the feeling that there isn't much interest, or at least no strong feelings. It's been a long time since anyone has expressed any preferences for how something like this would be implemented.
Now that Chain is in place, we are easing in to a model where this can be done with either very little configuration required, or with a fair bit of systemic support. I'm looking at splitting the default chain into an "action" command (which delegates to most of the familiar chain) and a "view" command (which would delegate to a small chain, right now just "PerformForward," optionally preceded by "TilesPreProcess". The lightest weight approach would be to slip a command or two in at the beginning of the view sub-chain which looked up an optional ViewController, which would just be a chain Command. Something like this would probably simply extract the "path" from the active ActionForward and use it as the name of a command to lookup. (How to best specify the catalog?)
A slightly heavier approach would be to add configuration properties to ForwardConfig and ActionForward which would allow you to specify things in your struts-config which would be helpful to a ViewController -- for instance, you might want to specify the name and scope of a form bean which should be made available to the ViewController for pre-populating, and maybe you would want to explicitly configure a catalog/command lookup value in the struts-config instead of or in addition to the path-based lookup.
Since form pre-population is one of the things I think Struts should make easier than it currently does, I'm leaning towards the second approach. You could certainly configure your commands with enough information that they could find the form to pre-populate themselves, but why not make it more consistent. The biggest hitch would be use cases in which the destination view actually needs to prepopulate two different ActionForms, but this is something I have yet to encounter in my own development, so I won't get hung up on it until someone who has encountered it speaks up with a better idea!
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]