1

The last months I have tried to get started with web developing using Java. I have been trying the Java EE 6 API and I also have been trying Spring. However, I still do not seem to grasp many of the concepts nor do I manage to set up the projects correctly because I find it pretty hard. Could somebody give me some book recommendations and also in which order it would be smart to start in?

Java EE 6 vs. Spring 3 stack

I read that question, but it is relatively old and I wonder if the answer still applies? Would you start learning Spring and Hibernate or Java EE 6 if you started today?

Community
  • 1
  • 1
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434

4 Answers4

1

Read an extensive discussion on Java EE 6 vs Spring at:

https://blogs.oracle.com/arungupta/entry/why_java_ee_6_is

Arun Gupta
  • 3,965
  • 5
  • 31
  • 39
1

Remeber J2EE v1.4? Was complex, cumbersome and verbose (but a standard and supported by all major Web Containers). In that context Spring emerges, as an alternative to build Enterprise Applications in an easy and elegant way.

It's been a long time since then, Java EE has learned from its mistakes and now the standard has adopted several of the features that made Spring great. By now, everything you can do with Spring+friends you can do with Java EE and standard technologies.

So it's just a matter of taste. Personally, I suffered a trauma with J2EE 1.4 and I'm a big Spring fan: I love it flexibility and the way it interacts with almost every technology/framework in the market. But I saw some Java EE 6 applications also, and they are far less creepy than their ancestors (and again, supported natively for all Application Servers).

Carlos Gavidia-Calderon
  • 7,145
  • 9
  • 34
  • 59
0

I will not say too much new, but here are my 2 cents. Neither is a silver bullet, I wonder if the answer is somewhere in the area of "it depends". From my limited exposure, there are a few general rules.

If you are developing in a well-defined environment (i.e. you know which container you will use), Java EE is a great choice. At the same time if you are building an app that will run across different containers, some the features (e.g. authentication) might end up having container-specific perks, so Spring would win there.

If deployment size is important, Java EE is a clear winner, as most of the jars from the standard development stack (JSF, JPA, CDI, etc) are provided by the container. Spring deployments quickly blow up in size (like by a factor of 5), especially after you add all the modules.

From the development point of view, Spring seems to have more high-quality documentation and you at least have a high-level understanding of how things are wired and interacting. With Java EE you are entirely at the mercy of container provider, which might not be well documented.

Nick G.
  • 557
  • 9
  • 18
0

If you need to build a command based wep application then go on with Spring and Spring MVC.

If you are able (and want) to build a component based web application then use that standard JEE6 Stack with JSP, CDI and some EJB.

Ralph
  • 118,862
  • 56
  • 287
  • 383