views:

2761

answers:

17

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.

+1  A: 

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

Bno
+2  A: 

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.

Alexandre Victoor
+2  A: 

Edit: I didn't realize there is an updated version

A little old but popular - An Introduction to the Spring Framework

mbowcock
+11  A: 

Get the great book: Spring in Action 2nd edition (http://www.manning.com/walls3/).

kolec
+4  A: 

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

James Law
A: 

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.

John Meagher
+4  A: 

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.

Michael Angstadt
I found this tutorial quite bad as a resource for learning Spring.Most of the times, files are modified in an anti-intuitive way. E.g.: you set things in the servlet.xml file before they even exist.They don't include references (or explanations) for most of Spring's important classes, they just use them. So I found myself digging into Spring's API doc checking out what "Errors", "ModelAndView" and other classes were about and how to use them. Not that it's a bad thing...It's like a recipe, but you don't really know what the ingredients are.
Fernando
I don't mean to completely discard the tutorial as a resource, but it's better to first know Spring, (Spring in Action being an awesome resource) and then using this tutorial to get into working with Spring.I disagree with completing the tutorial giving you firm ground to stand on. (Unless you do it as I did, reading the docs and Spring in Action in parallel).
Fernando
+2  A: 

The Spring refcard from DZone is also VERY handy for Spring newbies

http://refcardz.dzone.com/refcardz/spring-configuration

Johan Pelgrim
A: 

Check

http://oyejava.com/tiki-index.php?page=Spring

With code that helps in understanding

This is not working.
Rachel
A: 

Check this for tutorials on Spring and Spring Hibernate

vsingh
+2  A: 

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)

Sriram Viswanathan
A: 

you can check here also

Spring Tutorial

lalit
A: 

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.

Rosdi
A: 

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/

kdonald
+1  A: 

Following URL explains the basics and offer good examples and sample code.:

Nodexpert