Q)What are the different servlet scopes? =>Whenever a client request is a complex request, request processing may involve multiple servlets or the client requesting multiple times. In such cases, a servlet should be able share data among multiple servlets. =>Whenever data sharing in a web application is the requirement, we will have the concept called "servlet scopes". =>there are 3 servlet scopes. 1)request scope 2)session scope 3)application scope =>If data is stored in request object, it is said to be in request scope. =>If data is stored in HttpSession object, it is said to be in session scope. =>If data is stored in ServletContext object, it is said to be in application scope. Q)How many ServletContext objects are created? =>One per web application. =>As soon as the Java web application is deployed, Servlet Container creates ServletContext object. =>ServletContext object is available to all the servlets of the application. =>ServletContext object is destroyed only when the application is undeployed or the server is shut down. Q)How many request objects are created? =>One per client request. =>request object is created when the client request is received. =>Once request-response cycle is over, request object is destroyed. Q)Explain about MVC architecture. =>A Java web application contains 3 different logics 1)flow control logic(application loigc) 2)data accessing and data processing logic 3)Presentation logic(output generation logic) =>In MVC(Model, View, Controller) architecture of attending a client request, =>data accessing and data processing logic are implemented in a Java object known as Model. =>Model is divided into two components. 1)Business Component(service Object) 2)Data Access Object => Flow control logic(application logic) is implemented in controller. =>A servlet acts as a controller as per MVC architecture. =>What user sees is view. View Component produces the view for the users. In a Java web application, a jsp is used as a view component. MVC Diagram 1:- controller receiving the client request 2:- controller asks the model for processed data 3:- Model gives processed data to the controller 4:- controller swithing the control to the view component 5:- view component producing the response page for the client