While I agree with Vicky that the Struts ActionServlet is the main controller component, I continue to assert that the Action class is also part of the controller space. While it is the ActionServlet and RequestProcessor that actually communicate with the model, the Action class tells them both what to do ... which page to display next, and what data will go on that page.
To me, the real
test of which space a component belongs in is "what does it need to know about?". View objects should know only about other view objects and controller objects, as they should never communicate directly to the model. Model objects only need to know about other model objects. They should be "pluggable" to use any view or controller. Conroller objects, on the other hand, need to know about both view objects and model objects in order to mediate between them.
What does the Action class need to know about?
It needs to know about the view. Although it doesn't need to know the name of a
JSP, it does need to the name of an ActionForward that will eventually resolve to a JSP. It needs to know that we're using HTTP as the view protocol, because it receives it's input from an HTTPServletRequest and sends its output to an HTTPServletRespone. It needs to know about the javaBeans that are part of the view space in order to pass data to the view.
It needs to know about the model. It has to know which model objects to call in order to get the needed information. It has to know what format that information will be in and may have to modify it to accomodate the view.
Given this test, the Action class is clearly a controller object -- certainly not the only controller object, nor even the main one, but a controller object nonetheless.
The authors of the Struts documentation appear to agree with me on this. They list Action Mappings and Action classes as conroller components. Here's the link:
http://struts.apache.org/struts-doc-1.2.x/userGuide/introduction.html#controllerConcepts [ January 13, 2006: Message edited by: Merrill Higginson ]