Why is Spring MVC better than Servlets / JSP ?

Technology CommunityCategory: JavaWhy is Spring MVC better than Servlets / JSP ?
VietMX Staff asked 3 years ago

Servlets are based upon a low-level API for handling requests and responses. Web frameworks like Spring MVC are designed to make building web applications, which handle HTTP requests and responses, easier. Most Java web frameworks, including Spring MVC, use servlets behind the scenes.

Not necessarily ‘better’ but Spring MVC is essentially a higher level abstraction built on top of Java Servlets centered around the Model View Controller design pattern. This pattern promotes seperation of concerns when building your web application.

The linch pin of the framework is the DispatcherServlet class which actually is a Servlet implementing the Front Controller design pattern.