What is Controller in MVC ?
Is it struts.xml or Servlet (Action Class)?
Can we have more than one Controller in our ap
As you will be knowing MVC stands for Model - View - Controller.
Simply saying, Model contains our business components and logic, View contains our Presentation technology and Controller controls the flow of control and working of the application.
In Struts
There are two versions of Struts : Struts 1 and Struts 2.
**These two are different frameworks.
Struts 1 is based on Servlets. It has one ActionServlet that acts as its controller.
Whereas in Struts 2 we have Filters. In this we can have Filter like FilterDispatcher or StrutsPrepareAndExecuteFilter that acts as our Controller.
**In Struts 2, Actions act as Model.
The main job of Controller is to decide which Action class will handle which request And controller does this with the help of Configuration defined by us in struts.xml file or by annotations in case of Struts 2.