Question: I am trying to start learning the `J2EE` part of `Java`. But I don't know where to start. I am familier with `Core Java` and mainly, I want to learn `JPA` and basics of `Hibernate` and `Spring Framework`. The main reason for this is I am working on a project which is using all these things. And most of the code is being developed by some senior guys and I have to make some modifications in that. So basically I need to understand their code. 

Can someone give me a sort of roadmap, like which things I need to know beforehand and in what sequence should I go? Any reference material, like links, books?

Answer: 
Whenever I want to learn a new framework/language, I usually whip up a small project that uses it. For a web framework, I have a common webapp that I write using it. It's simple and doesn't do much, but it has enough features that I need to take advantage of the more common parts of the framework (database, background jobs, mvc or whatever similar such). In fact, not long ago I took up the task of learning Spring/MVC+Hibernate. I don't know it all, certainly, but it gave me enough of a background that, when I don't know something, I know what questions to ask and how to ask them to get more information.

For web frameworks, I usually start with the simple "hello world" example provided for most frameworks. If it has a "guestbook" example (ie, to show database use), I follow up with that. From there, I just start adding the functionality I want in my learning application, beginning with the simplest. The idea being that I can figure out how to ask the right questions for the simple things. After I've done some simple things, I can then look at the more complex things and, with the information I've already learned, I can hopefully formulate the right questions to ask for them.

I recently started putting the [code for such learning projects on sourceforge](https://sourceforge.net/projects/rhs-galleries/), if you're interested.

*Edit: Donal's comment made we want to add... I didn't put the link in as an example for you to learn from. Rather, just as an example of me putting my code out there. If you want to really learn, you need to write the code yourself, not just read someone else's (in my opinion, at least)*
I was in a very similiar situation not long ago. Here's roughly what in retrospective, I found the most useful approach to quickly learn the basics of a new technology:

**General approach:**

1. **Find out what problem it solves.** Read various resources like the project's homepage, the wikipedia article.
2. **Find a small project that contains said problem**. E.g. in your case, a small webapp managing your DVD collection with the possiblity to lend them to friends.
3. **Start to think about what mechanisms you would *expect* to be provided by the technology**. E.g. for an ORM solution, a mechanism to specify whether a relation is `1:n` or `n:n`.
4. **Search for these mechanisms in your technology**: E.g. in JPA, find the `@OneToMany` annotation. Often, this is where you work yourself through a *Getting Started Guide* or the senior developer's code.
5. **Implement your mini-project using these mechanisms**. While doing so, you will discover the limitations and probably a few other features. E.g. in JPA, the *N+1 selects problem* or a feature allowing you to automatically *drop & (re)create tables* for your Java classes.
6. (If you can afford the time): **Try to understand how you would implement the mechanisms**. Doing so can help you understand why certain limitations exist and how you can work around them.

One note about Getting Started Guides: **Don't read them before step 4.** If you still do, this *will* bite you if you are learning very powerful frameworks like Spring with all its fancy features. As always in life, the more powerful your tool is, the easier you can screw up if you don't truly understand it.