Why servlet is used as controller ? Not JSP? I want complete explation?



Why servlet is used as controller ? Not JSP? I want complete explation?..

Answer / Mamta Maurya

Servlets are used as controllers in Java web applications because they provide a powerful and flexible way to handle HTTP requests and generate dynamic content. Unlike JSP, Servlets offer more control over the request-response lifecycle, allowing developers to implement business logic, manage state, and handle multiple requests concurrently using multithreading. Additionally, servlets can easily interact with other technologies such as databases or legacy systems.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Servlets Interview Questions

What are the difference between HttpServlet and GenericServlets?

2 Answers  


What is context switching?

6 Answers  


What compiler do not do if we create our own constructor?

5 Answers   HCL,


How many ways are available to ger RequestDispatcher object?

4 Answers   Polaris,


Explain the lifecycle of a servlet?

1 Answers  


What are the annotations used in servlet 3?

1 Answers  


How many ways to remove the session object in the container

6 Answers   Bosch,


How many Cookies can a host support?

2 Answers  


How can the session in servlet be destroyed?

1 Answers  


What are the uses of servlet and what is servlet chaining?

1 Answers  


how the server will know its the same jsp page?

3 Answers   HCL,


how the HTML data stored in web server?

1 Answers   TCS,


Categories