struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict" <pbened...@apache.org>
Subject Struts 1.4: New Dispatcher package
Date Tue, 25 Nov 2008 23:21:06 GMT
I am happy to announce that I moved a little closer at integrating
Struts 1 and 2 seamlessly. As always, my goal is to mesh them within
one context without losing any S1 functionality.

One issue of Struts 1.x is that dispatching is supported exclusively
within the Action. Many designers note it as a flaw -- that an Action
would execute the dispatching logic itself -- and I see some truth to
this. A better solution is to make the Controller handle this
responsibility outright. Thus, a new "dispatcher" attribute has been
added to the action mapping. The Controller can now delegate to the
configured Dispatcher which will in turn invoke the Action.

What's neat about the Dispatcher interface is that it takes an
ActionContext and returns an Object. The input can be for a servlet
(ServletActionContext), a portlet, or any other kind of medium. The
output can also be anything. So the classic execute() signature
doesn't have to be so anymore.... as long as the Controller can
interpret the response. Four kinds of responses are handled out of the
box:
 * ActionForward (as before) to forward
 * null (as before) to handle the response directly
 * String, to represent a forward name
 * void, to represent calling the SUCCESS result

I see two potentials. (1) Possibly any kind of dynamic method
signature and (2) S1 mapping can delegate to S2 actions and
vice-versa.

There's some more javadoc to do, but please take a look in SVN in the meantime.

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message