Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

more than one controller possible

 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we use more than one controller in web application
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure.
 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is more than one controller possible in mvc2 design pattern
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
Sriram Sharma
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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!

Regards,
Sriram
 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont know. my interview asked can you use more than one controller in one web application.
 
Sriram Sharma
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Prakash...
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.

Regards,
Sriram
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic