Java is one of the most popular programming languages in the world even today. The reason for its consistent popularity has a lot to do with its robust frameworks. For any commercial project development, a framework is a must for organized implementation. When it comes to Java, there are many popular frameworks available and different programmers have different preferences.
Some of those popular frameworks are Spring, Struts, Hibernate, JSF, Vaadin, GWT, Grails, and others. Out of all these frameworks, Spring framework is the most popular and most widely used across the world.
Spring on the other hand is lightweight because it allows minimally invasive development with POJOs. A lightweight framework makes itself as invisible as possible. One of the ways it does this is by encouraging POJO-oriented development.
As others have already pointed out, Spring is considered lightweight compared to traditional Java EE applications. That is precisely the argument for Spring being heavyweight. Modern applications have to do a lot of stuff in order to be competitive. If your app isn’t doing that stuff in your code, then that means the framework is. The more that the framework is doing stuff for you, the more heavyweight it is.
Those Java EE applications used to be deployed to heavyweight application servers (websphere, weblogic, etc.), whereas Spring could be deployed to a lightweight web container like Tomcat or Jetty.
In the past few years, the industry started shifting towards more and more lightweight models. Java EE introduced the Web Profile which is only a subset of the full Java EE feature set.
Pivotal also introduced the Spring Boot framework which greatly simplifies things working with Spring and it's also able to run as a jar application from the command line using an embedded Tomcat/Jetty/Undertow web container.
Similar to Spring Boot, there's Dropwizard, Ratpack, Spark, etc. which are even more lightweight frameworks compared to Spring as they are targeted at creating microservices and only include the bare minimum needed to create web applications.I should also mention the Play framework and Vert.x. These frameworks are also considered lightweight while they provide a rich feature set.
Related blog: