Source: Wrox Professional Java Development With The Spring Framework, page 50

There is some confusion about whether Spring competes with J2EE. It does not. J2EE is most successful as a set of specifications for low-level services; Spring is essentially an enabler of an application programming model.

Spring does compete with many services provided by EJB, but it's important to avoid the mistake of confusing EJB with J2EE. EJB is a component model that enters the application programming domain; J2EE is a platform that deals more with consistent provision of low-
level services. Spring in fact allows you to use J2EE more effectively. It allows you to dispense with EJB, and the complexity it entails, in many cases, while providing support for implementing and accessing EJBs in case you do choose to use them.

In reality, Spring competes far more with in-house frameworks. As we saw at the beginning of this chapter, trying to develop applications with J2EE out of the box is cumbersome and unwise. For this reason, many companies develop their own proprietary frameworks to simplify the programming model and conceal the complexity of J2EE APIs. Spring provides a far better option, with a powerful, consistent approach that has been tested by tens of thousands of users in thousands of applications.