Please recommend some good resources(especially must have books) about spring framework?
Pro Spring is a great book. I think the best way to learn is to try some of the sample apps out.
The official reference documentation is of an unusually high quality for an open-source project and has one considerable advantage over books: it's guaranteed to be up-to-date.
Use this tutorial. That's what I've been using.
Then refer to Pro Spring.
If you're interested, we've developed a reference web application called the Examinator that is based on a Spring stack and demonstrates Spring, Spring MVC, Spring data access with JPA, Spring Security, Spring transactions, Spring Web Flow all wrapped up in a Maven project executable with Jetty or Tomcat. It uses Terracotta to make it scalable and has been tested up to 20k users on a 16 node cluster. It's open source so you can look through how we did all sorts of stuff.
The link to this has gone missing in the latest doc organization but you can find some info here:
To get going quickly I would start with the Spring MVC Tutorial. It doesn't cost anything, doesn't take long to run through and gets the main points across.
As far as books are concerned I pesonally have the following...
- Professional Java Development with the Spring Framework - not bad, but leaves the reader with the impression that it's been put together quickly
- Pro Spring is pretty good.
- J2EE Development Without EJB is a little older now, but explains a lot of the rationale behind Spring.
There may be newer books now covering Spring 2 in more detail. I would recommend having more than one book handy, as they cover different areas at different levels of detail.
Hope this helps.
I can recommend Spring Recipes and Pro Spring 2.5. The first helps to get some results quickly, the second is a solid reference book with advanced topics.
Spring Recipes is great.
If all you need to do is to wire beans together: this is very easy using Spring and the official docs are very good.
I would recommend that you write lots and lots of test code and then throw it away and do it again properly.
Take a look at constructor injection, setter injection etc and try different ones out.
I've found following to be very usefull:
- Spring in Action
- Building Spring Enterprise Applications: From Novice to Professional
I needed to do this for a job a while back. I used Spring in Action, as suggested elsewhere, just reading the core section and the sections on jdbcTemplate and Hibernate integration, since I knew I'd need those. So, figure out what you need, and study the right sections, not the whole book, if possible.
Also, I did this tutorial. I picked this one to suit me, but there are many tutorials out there. I worked through the whole thing, got to run it and watch the gears turn, which is a key part of understanding how the thing works.
To quickly see a project and some code in action you should check out the SpringSource Tools Suite (It's based on eclipse). I find the quickest way to learn something is to start playing around with examples.
The "STS Dashboard" contains tutorials for a bunch of Spring topics and the nice thing is they setup an actual project and walk you through the code. For web based applications it will even deploy to tomcat so you can see it working. At the end, you have a working project to play around with! Once you have that you can try out everything from all the great documentation sources referenced in the other answers.
Have you ever thought of taking a SpringSource class? You can learn Spring in a 4 day class that's hands-on. You can find Core Spring classes in your area.