I am a Java developer but up to now have not had any hands on experience using the Spring framework.
Does anyone know of anyone good online tutorials that explain the basics and offer good examples and sample code.
I am a Java developer but up to now have not had any hands on experience using the Spring framework.
Does anyone know of anyone good online tutorials that explain the basics and offer good examples and sample code.
First of all you have to realize that Spring is big. It has a lot of modules with different goals.
This helped me a lot: Introduction to Spring Web Framework
The spring reference documentation is very well written. You might also take a look on Matt Raible's appfuse-light demo application. Most developpers I know have learn Spring using appfuse.
Edit: I didn't realize there is an updated version
A little old but popular - An Introduction to the Spring Framework
Get the great book: Spring in Action 2nd edition (http://www.manning.com/walls3/).
The spring documentation itself is quite awesome. But I would second buying spring in action. Spring is big, but you typically can peel it like an onion. Use spring first to help with data access, and tx management (jdbc/hibernate), then later use it to manage quartz, jms, jmx... Don't try to learn all at once- start with simple java programs (main) that bootstrap the container and do something. Wouldn't recommend jumping directly to a 3 tier webapp.
Spring in Action and a couple days building a small app was how I got started.
Also- The source code is amazingly well documented, so don't forget you can attach source to your jars, and F3 into things (in eclipse) --James
There's a pretty good tutorial included with the Spring download. It's under docs/MVC-step-by-step. Also included in the docs folder is a good reference for Spring. The reference is also available online.
The Spring guys themselves have a tutorial that teaches how to build a basic Spring web application from absolute scratch.
http://static.springframework.org/docs/Spring-MVC-step-by-step/index.html
Having to work with an existing Spring application without much knowledge of Spring will quickly overwhelm you. Completing this tutorial will give you firm ground to stand on.
The Spring refcard from DZone is also VERY handy for Spring newbies
I am also just starting with Spring.
This is one of the best introductory tutorials I have found -
http://maestric.com/doc/java/spring (Spring MVC Fast Tutorial)
I personally prefer Beginning Spring Framework 2 by Wrox as opposed to Spring in Action. That is probably because I learn better by example. (Disclaimer, I have not finished reading SIA, way too much theory but not much (not any?) code samples).
I can only follow SIA after I have done reading BSF2. BSF2 not only explain why you should use Spring but also show working code snippets. It shows why Spring will make your program more testable, more modular, cleaner, etc. The AOP part is an eye opener (for me at least).
After you are done with BSF2 you will not only learn Spring, but also TDD, AOP, JPA, etc. You will even learn how to design applications with Spring, starting with the domain model approach.
SIA only explain but does not give much code to try, so if you are completely beginner with Spring you will wonder when you can start to do some coding.
I may change my mind after I am done reading SIA, but so far, BSF2 is my choice.
The following showcase illustrates what Spring MVC can do for developing Java web applications: http://blog.springsource.com/2010/07/22/spring-mvc-3-showcase/
Following URL explains the basics and offer good examples and sample code.: