Joe Germuska wrote:
Where would ActionCommand fit in, more specifically? Is the idea that you'd rig the chain to use a different command that fills the general role of the current "ExecuteAction" command? Did you guys come up with more specific APIs for the ActionContext and ViewContext?
The bottom line of these three classes is it replaces Action and, while providing a new default ActionCommand interface, opens the door to alternative action frameworks.
ActionCommand would look like this: public interface ActionCommand { public void execute(ActionContext ctx); }
...notice execute() isn't capitalized, mr .net Ted :) This interface could also possibly return ActionForward to fit easier into existing Struts concepts. Any place Action is used now, we would expect an implementation of ActionCommand. The nice thing about chain is we can support both side-by-side - simply add a command that checks the action with an "instanceof Action", and if not found, it ignores the class, letting the second chain command check for "instanceof ActionCommand".
ActionContext is based on code I wrote for a POJO action framework extension for Struts a little while back. It is initialized at the start of the chain, receiving the chain Context. It then stores an instance of itself in threadlocal, to be optionally retrieved by ActionContext.getCurrentInstance(). It contains all the methods we now have in Action like saveToken(), getMessage(), etc., in addition to extending Context, so its get() implementation, if the chain context is an instance of WebContext, looks for beans with the proper order (request, session, application, local). For the POJO action framework, which looked quite like a JSF backing bean, anytime the action needed to get Struts or web-specific things, it called the static method to get the instance of ActionContext.
Now that I think about it, I'm not sure what ViewContext would contain. Ted was thinking it would be based off VelocityTools, but I don't see anything there that couldn't be stuck in ActionContext.
Don
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]