Why servlet used as controller in mvc2?plz explain details

Showing Answers 1 - 6 of 6 Answers

Mvc1 no concept of controller, view directly interacts with model.
This makes both view and model tightly coupled, thereby multiple view technologies are not leveraged. All three factors are opposite in
Mvc2. Mvc2 controller concept is introduced, where it plays a centralized role. Controller is configured to spit any of the predefined
view technologies to name HTML, XML, JSP, WML etc. Controller is also configured on the model it can interact with. Model represents
business layer, so it could talk to any data model like business components (EJBs), JDBC to interact with any database or say Hibernate
Webservices etc. All client requests are configured to land at controller, so it could check security, logging, session handling. Since
servlet is best bet having these characteristics, servlet controller component is introduced in Struts.

  Was this answer useful?  Yes

sunil.yadav

  • Jan 31st, 2007
 

According to MVC 2 model View should not know about the model and model should not know about view, both has to be totally independent from each other and servlets serves the purpose of interface between these two bridges because of its powerfull APIs.

  Was this answer useful?  Yes

JavaPassion

  • Aug 12th, 2007
 


 Nice question .

The MVC -2 has decided to use controller as struts and jsp as views because , the view of a site may change from time to time , so its best to keep JSP as view as no need to recompilation of JSP .

The servlet is taken as a view it should be recopiled everytime according to client.

  Was this answer useful?  Yes

prateeks88

  • Nov 4th, 2008
 

According to MVC2 the purpose of addition of the controller was to just separate the dynamic part of the application from the static part and for that the dynamic part given the name "view" is handled as
JSP's . while the static part as controller (servlets), but we could have used JSP instead of servlets as it may rise some benefits too,

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions