One way I could see doing it would be do add a PrepView attribute to the action mapping that would be in the form "class.method". Basically, any time validation fails and your going to return to the input page, call that method, who's job it is to prep the page for viewing. There's of course details in there to be dealt with, but the basic idea might be good. That way, the choice would be the developers whether they want to have a new class to do this work, or just make it a method of an existing Action (I could see either being appropriate in some situations).

This is similar to some things we've done or thought about. 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. 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.


More importantly, though, wouldn't you want to hang the "PrepView" configuration off of the forward config instead of the ActionMapping? 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...

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]



Reply via email to