I couldn't find it in the archives, but I did find it in my own trash folder...

It was actually from Joe, in reply to Hubert, as part of the discussion about what I was doing. As I said, it's not exactly what I did, but it is very much along the same lines, except that it's for the 1.3 branch, and is per-forward only. Here's the message:

Hubert wrote:
And I've been silently wishing you'd add it, too.  :)
We've had discussions about this maybe twice before, and another time
I lit the flame, you responded, but I wasn't able to follow through
with the discussion.

Joe wrote:
Well, then, now you've gone and done it, Hubert...  I've just committed the 
basic support for per-forward commands.

I think the next step would be to write a simple command which looks something 
like this:

public class FormPrepCommand implements Command {
private String formName; // property
private String formScope; // property

public boolean execute(Context context) {

  if (this.formName != null) {
    ActionContext actionCtx = (ActionContext) context;
    ActionForm form = lookupForm(formName,formScope, actionCtx);
    prepareForm(actionCtx, form);
    return false;
  }
}

  protected ActionForm lookupForm(String formName, String formScope, 
ActionContext ctx) {
    // standard behavior for looking up a form and making sure its in the right 
request/session scope
    // classes would rarely override this; maybe it would be private.
  }


protected abstract void prepareForm(ActionContext ctx, ActionForm form);

}


Then one could use one or more of these in a per-forward chain of renders. Of course other commands could do non-form oriented setup.

Related to what I just checked in, I still like a model where rather than configuring command and 
catalog on each ForwardConfig, a lookup is done based on the "path" value of the 
ForwardConfig.  No reason not to have both, of course, but I just think my style would be to have a 
catalog named "page-prep" and a different command in process-view which worked this way.

Joe



Frank W. Zammetti wrote:
Fair enough, I wasn't certain. :)

I'm trying to find the relevant message now so as to not be posting FUD by mistake!


-- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to