J2EE Vs Spring

Java EE is an standard, official, specification for a full featured Enterprise Application Framework stack. Includes stuff like Object-Relational Mapping, Security, Web Applications, database connectivity, transactions...
On top of Java EE specifications there are JavaEE implementations/application servers like: JBoss, Glassfish, WebSphere, Weblogic.
Spring on the other hand, is a framework doing lots of the stuff on the Java EE specifications, but in its own form. They don't follow Java EE specifications and APIs for that. But they do include a Web Framework, transaction management, security and several other solutions Java EE offers.

------------------------------------------------------

Java EE:
  1. Java EE industry approved standard API based framework
  2. IT is predominantly based on annotation and CDI
  3. JFC MVC framework for web development
  4. JPA implementation to process DB operation
  5. JTA API with implementation
  6. EJB container and POJO based implementation
  7. Oracle license
Spring:
  1. Based on IOC and AOP
  2. Based on XML configuration (now they are leveraging annotation)
  3. Uses Spring DAO framework (based on Template design patter) to connect to database
  4. Provide abstraction layer to support various JTA implementation vendor
  5. Ingrate with various Java vendor to support different capabilities such easily integrate with struts etc
  6. Provide end to end platform to build web application achieving loose coupling using DI and AOP
  7. Open source license

-----------------------------------------------------


Java EE:
  1. A Sun/Oracle standard that app server vendors conform to
  2. Based on Enterprise Java Beans
  3. Implemented by many vendors: BEA/Oracle, WebSphere, JBOSS, Glassfish, etc.
Spring:
  1. Not a standard; it's the brainchild of Rod Johnson and implemented by Spring/VMWare.
  2. Not based on Enterprise Java Beans; it's a POJO model. Can manage EJBs if you wish to use them, but not required.
  3. Not implemented by any vendor other than Spring.
EJB 3.1 has taken a great deal from Spring. Now it includes dependency injection, a form of aspects, and JPA. EJB 3.1 is much closer to Spring than EJB 2.0 was.

----------------------------------------------------------------

Ref: Stackoverflow

Comments