102

My goal is to make web applications!

I finished reading the Books "Headfirst - Java" and "Headfirst - Servlets and JSP".

Because this topic (web applications) is so big and complicated, I would like to ask what I should learn next. I feel overstrained when I read catchwords like Java EE, EJB, JSF, JPA, Glassfish ... but I won't give up.

Can anyone please tell me how I should proceed with learning? Should I grab a book like this: Beginning Java EE 6 Platform with GlassFish 3: From Novice to Professional or should I just make some Online tutorials?

Thanks!

creativz
  • 9,039
  • 12
  • 34
  • 35
  • Duplicate of : http://stackoverflow.com/questions/1958472…,http://stackoverflow.com/questions/1084591…,http://stackoverflow.com/questions/125160 – Rachel Dec 25 '09 at 04:00
  • 22
    Except that all these questions are outdated since Java EE 6 is out... – Pascal Thivent Dec 25 '09 at 04:12
  • @Pascal - except that most of Java EE 6 will have close parallels with earlier Java EE releases. So they'll only be slightly outdated. – Stephen C Dec 25 '09 at 07:36
  • 4
    @Stephen Well, I actually think that there is a **big** gap, especially on the web part (with Servlet 3.0 or JSF 2.0 and CDI managed beans). – Pascal Thivent Dec 25 '09 at 08:26
  • 1
    I've read the two threads. But again: In the threads they are only saying "learn Tomcat, JBoss, Hibernate, learn this or that, etc..." Just throwing with words. But I want to know which specific book or tutorial I should lern. Maybe there is no such way and I have to learn it "inefficiently" by looking every single word up. I justed hoped to get an advice how to proceede. – creativz Dec 25 '09 at 02:38
  • 1
    I would recommend you to start with Head First Servlets and JSP provided you have good knowledge of core Java. If you are not comfortable with Java as Programming Language than first you need to get some hands on knowledge on it and than proceed towards Web Application Development. – Rachel Dec 25 '09 at 04:03
  • What is the exact thing you want to learn, if you have gone through JSP and Servlets Head First Series than probably you should start with developing some small web application testing your theory knowledge and than you can always do enhancements on it and change framework once you get hang of how to develop web application using Java EE Technologies. – Rachel Dec 25 '09 at 04:05
  • 1
    Funny how many of high voted general questions like this one are closed as "not constructive". I'd say they are very constructive, but not easy to answer in a constructive way. They do help to see the bigger picture of what one is doing or should be doing. But it's nice that they are allowed to stay on SO. – jackthehipster Aug 22 '14 at 08:57
  • @jackthehipster totally agree! I always find such questions more valuable than those `specific` questions. It is such questions that make SO different from others. – smwikipedia Jan 21 '15 at 12:29

7 Answers7

174

Even if I know that this will be controversial, my advice would be to start with Java EE 6 only. So, grab GlassFish v3 and either get the book Beginning Java EE 6 Platform with GlassFish 3: From Novice to Professional or follow the Java EE 6 tutorial. In my opinion, the book (that I've started to read so I know what I'm talking about) provides more guidance which might be preferable if "everything" is new for you (it covers both the Java EE platform and its APIs and the environment to build, deploy your applications).

Now, as I said, I can already hear voices saying things like "Java EE is heavy, use Spring instead, learn Struts or Wicket or Stripes for the presentation layer, learn Hibernate for persistence, or not because I don't like ORM, use iBatis or straight JDBC instead (you'll see, it's cool with Spring, Spring is so cooool), and use Tomcat (and why not Jetty), or JBoss, or just forget all this and go for Grails, and bla bla bla...".

But I don't think that this is really helping you and, without mentoring or guidance (and you won't find a non outdated unique resource covering all combinations), this must sound very confusing for a beginner.

So, because I think that Java EE 6 is a big improvement over previous versions of Java EE, because it provides really nice standard APIs for all your needs (Servlet 3.0, JSF 2.0, JPA 2.0, EJB 3.1 lite, Bean Validation 1.0, CDI, etc), because these APIs are all more than decent, because there is nothing really wrong in learning them, because this is already a big task, because you have to start somewhere, I'd focus on Java EE 6 only and forget the other frameworks for now. More precisely, I'd start with the Java EE 6 Web Profile (and then add things if you want to go further).

By doing this, 1) you'll get started and you'll learn brand new things and 2) you'll give some time to all other frameworks and/or tools to adapt and prove that there is still a need for them. And if there is, it will still be time to experiment the survivors and you'll be able to understand much better why they exist.

Cœur
  • 32,421
  • 21
  • 173
  • 232
Pascal Thivent
  • 535,937
  • 127
  • 1,027
  • 1,106
  • 3
    Thanks. Regarding the book, I've not read it entirely but I'd definitely recommend it for both novice and experimented developers that want to get a good overview of Java EE 6. The book is well constructed, it really covers many APIs (not much are missing), it has code samples demonstrating everything presented, they are really didactic and allow to go as deep as you want. There might be more focused books in the future but this is a good one. – Pascal Thivent Dec 25 '09 at 07:17
  • 24
    +1, but Spring is so cooool :-) – ChssPly76 Dec 25 '09 at 07:39
  • 13
    Don't misinterpret me, Stripes, Spring, Hibernate,... are great. But too much choice can be confusing when discovering something new and I believe that Java EE 6 allows you to start without them. – Pascal Thivent Dec 25 '09 at 08:20
  • 9
    I agree with you, it's very important to learn the JEE stack even if you wouldn't use any of it, after all that stack **is** the baseline for all the fabulous frameworks which make things truly great, for example Wicket is built on top of the concept of Front Controller which in Java world means Servlets and Filters - if you don't know how those work, you won't really understand what Wicket is doing either! Unless you accept *"magic!"* as answer, of course. – Esko Dec 25 '09 at 09:34
  • You're putting JBoss amongst Tomcat, Jetty etc? JBoss is Java EE company, right? The one most established in enterprise business AFAIK. – Ondra Žižka Jun 21 '10 at 03:11
  • @Ondra No I'm not, I was just listing alternatives to illustrate the possible confusion. – Pascal Thivent Jun 21 '10 at 12:08
  • +1 for "start with Web Profile" – Thorbjørn Ravn Andersen Oct 07 '10 at 10:29
  • 13
    4 plus years later.... would you change anything about your answer? – jlars62 Jun 06 '14 at 17:10
  • without mentoring or guidance is so painful +1; (and you won't find a non outdated unique resource covering all combinations +1, it's not like .net -- For dot.net just only install vs, and get a very thick book, everything you got!) – gfan Oct 30 '16 at 09:49
29

My advice1 is to stop reading books and start implementing stuff. In my experience, book learning is poor a substitute for the knowledge you get by actually doing things.


1 - Context: this is advice to someone who has just finished reading two books on the topic, and is looking for more books to read. In practice you need to balance reading and doing. Especially if you have a specific problem you are trying to solve.

Stephen C
  • 632,615
  • 86
  • 730
  • 1,096
  • 29
    But it could save you days of searching. Could also give you enough knowledge to answer question instead of asking them and eventually having high reputation in here, don't you agree ? – Muhammad Gelbana Mar 15 '13 at 19:29
  • 6
    No I don't agree. The OP has already read two Java / Java EE books. It is time for him to do some programming. FWIW, I didn't get most of my knowledge from reading books. Rather I got it PRIMARILY by implementing things, and referring to the documentation when I needed to. You don't learn to ride a bicycle by reading books ... and you don't learn programming skills that way either. – Stephen C May 21 '13 at 10:28
  • 3
    It's important to balance `reading` and `practice`. – smwikipedia Jan 21 '15 at 12:38
8

Java EE 6 is really amazing. The only problem is that it's about 2 weeks old, and there is only 1 container currently offering it's features -- Glassfish.

I have nothing against Glassfish, I use it all over the place, several production instances, I love the product and the project.

That said, the details of Java EE 6 do not translate back to Java EE 5. Some do, many do, but the Web Profile, Servlet 3.0, the new Bean types, JPA 2, etc. Those aren't there.

So, by learning Java EE 6 first, you're simply constraining yourself to a single container. More are coming, but they're not here yet.

Tomcat, JBoss, OpenEJB, Glassfish, Jetty, Resin, Geronimo, etc. all work well with the Java EE 5 spec (at least those parts of the spec that they support, Tomcat doesn't have EJB for example).

I can't think of anything in Java EE 5 that wasn't carried forward to Java EE 6. Java EE 6 made some very old aspects optional, and those you simply wouldn't learn today anyway. Java EE 6 made some Java EE 5 stuff even easier (packaging notably, EJB Lite for example).

Learn Java EE 5 now so that you can actually apply what you learn in a variety of environments, rather that learning Java EE 6 now and discovering you may not be able to use much of what you learn.

No single book will teach you what you need to know. Servlets, for example, are a nice foundation, but for anything larger than a couple of pages or endpoint, you will want to use one of the many 3rd party frameworks, or JSF, and no book covers the core and then a framework on top of that.

The Java EE 5 tutorial is good at getting the foundations down, my major complaint is that they don't show you the source code. Rather they expect you to just download and run it. It's not discussed in the tutorial. I've found the Head First books to be pretty good.

For web programming, raw Servlets are important enough just to understand the request/response cycle but you don't need a deep understanding to make a leap to a 3rd party framework.

I'm a big fan of Stripes for an Action framework (vs a component framework), and the single Stripes book available is excellent (making choosing that an easy choice).

I can't suggest a Component framework book, and I actually would not recommend one right off. The component frameworks truly bury the HTTP core request/response structures. They bury them for a reason, and they gain value BY burying them, but I believe to be effective you need to have a solid understanding of these concepts early on. That's why I don't suggest learning a Component framework first.

The JAX-RS REST framework, included in Java EE 6, but readily installable in Java EE 5 or any servlet container, is excellent. Arguably it is what Servlet 3.0 should have been. But I don't know any books for that.

Arjan Tijms
  • 36,666
  • 12
  • 105
  • 134
Will Hartung
  • 107,347
  • 19
  • 121
  • 195
  • 2
    Question is what the state of application servers is when you are ready for production. If a given project takes 6 months from now, Oracle and JBoss most likely have JEE6 compliant servers, and Resin most likely have a JEE6 Web Profile server out. – Thorbjørn Ravn Andersen Feb 26 '10 at 14:14
  • Well, JBoss is due in December. Oracle lies low. Resin has gone quiet regarding their web profile implementation. Geronimo goes for Web Profile with 3.0 (beta). Glassfish is out in 3.0.1 which is really nice. – Thorbjørn Ravn Andersen Oct 07 '10 at 10:31
4

For Tomcat, read the manual on the website. It is very good. Particularly, the first few chapters on web app organization and deployment, and the chapters on the Servlets API and JSPs.

For Spring, the Manning book Spring in Action is very good. Similarly for Hibernate (the Manning book) but I think Hibernate is mostly outside the scope of webapps. Your call, though.

Wicket - Manning book also. But really, just write your front-end code in Javascript. It will be less painful, IMO.

danben
  • 73,814
  • 18
  • 117
  • 141
3

Jpassion provides good videos and material to learn Java EE 6 and other stuff.

You should also see applications examples:

  1. Petstore. Requires Maven, Glassfish recommended. Written by Antonio Goncalves who wrote the mentioned book.
  2. JBoss Ticketmonster. Requires Maven & Jboss Forge. Deploy in Jboss.
Arjan Tijms
  • 36,666
  • 12
  • 105
  • 134
jacktrades
  • 6,766
  • 13
  • 50
  • 80
3

I won't comment on other technologies but if you want to learn Hibernate get "Hibernate Made Easy" by Cameron McKenzie(www.hiberbook.com). It is worth every penny. You can finish reading that book in 2 days(literally). it is like a novel and at the end you find yourself dealing with Hibernate like a Semi-Pro.

motiver
  • 1,882
  • 4
  • 17
  • 20
2

If you just want to create web applications in Java, check out the Play Framework. It is similar to "Ruby on Rails"

Apeirogon Prime
  • 1,148
  • 11
  • 25