Can you please explain how is it possible to have 2 controllers in single web application?
Would like to have a basic architecture information on this. I am unable to get how!
Joined: Sep 10, 2009
I dont know. my interview asked can you use more than one controller in one web application.
Joined: Apr 12, 2006
I can understand that.
But, if you are going to take up more interviews, the question will not stop with this.
As soon as you say "Yes", the next immediate questio will be "How? Explain"
So, we need to know the complete depth of the subject. Its not just about "Yes" or "No".
If you get to know the answer, please pass on the solution to me as well.
Well, You can have any number of controllers in a web app. The fact that only one controller is come from Front Controller design pattern (Struts, Spring MVC etc.. utilizes) which, upon getting a request deals with the necessary components (i.e: request params, model, view etc.. which are configured by meta data) and generate the output ultimately. That makes code very easy to manage. Instead of this you can have separate controllers for each use case etc.. but that will be hard to manage.