views:

71

answers:

2

I very often come across this question of why we have got lots of web frameworks addressing the same or similar drawbacks.

When looking deeply, I also have given thought on why JSP / Servlets is not being used after the other web frameworks (like Struts, Spring MVC etc) have shown their existence?

Is it because, the latest web frameworks

  1. does most of the things on its own?
  2. provides extensive features that is not available with Servlet / JSP?
  3. or the Servlet / JSP is impotent to deliver what latest framework does?

Any help in the form of responses or resources is greatly appreciated.

+1  A: 

Spring MVC still works with JSPs and in its core it provides nothing more than a simple dispatcher servlet that uses the mechanisms provided by the Spring MVC framework (where you register your controllers in etc.). I would say it is about convenience and making things a lot easier to write and maintain. Additionally you can react more easily to current developments (e.g. RESTful services... you would have to code all of it by hand in a servlet). In the end that is what frameworks are for.

Daff
A: 

All of those frameworks are built on top of Servlet API. They only removes the need to reinvent the wheel with regard to collecting the request parameters, validating/converting the values, updating the model values and/or providing a component based view, etcetera. All the stuff you'd need to take into account for almost every HTTP request/response cycle.

With those frameworks you basically end up with just a Javabean class as model and a JSP file as view. The remnant goes in configfiles/annotations/framework-provided controllers/etcetera. Without those frameworks, you would need to write a lot of code to let the Javabean class and the JSP file interact with each other as easy/seamlessly.

Using just "plain vanilla" JSP/Servlet is still possible and acceptable for smaller websites. You don't need an overwhelming framework when you for example would like to have just a contact form. This is a perfect job for a simple JSP file and a simple Servlet class.

BalusC