Spring MVC Fast Tutorial: Dependency Injection

What are we going to build?

Use singletons of CarManager and BrandManager instead of creating multiple instances.

What is dependency injection ?

Dependency injection (also called inversion of control) is basically giving an object what it needs instead of letting this object get it by itself.

CarManager singleton for CarListController

For the moment, CarListController gets its instance of CarManager by itself:

CarManager carManager = new CarManager();

Let's change that by making it an attribute:

package springmvc.web;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
 
import springmvc.service.CarManager;
 
public class CarListController implements Controller {
	private CarManager carManager;
 
	public ModelAndView handleRequest(HttpServletRequest arg0,
			HttpServletResponse arg1) throws Exception {
 
		ModelAndView modelAndView = new ModelAndView("carList");
		modelAndView.addObject("carList", this.carManager.getCarList());
 
		return modelAndView;
	}
 
	public CarManager getCarManager() {
		return carManager;
	}
 
	public void setCarManager(CarManager carManager) {
		this.carManager = carManager;
	}
}

We now need to instantiate a CarManager somewhere else and pass it to this controller. It's done in '/WEB-INF/springmvc-servlet.xml':

<bean id="carManager" class="springmvc.service.CarManager"/>
 
<bean name="/list_cars.html" class="springmvc.web.CarListController">
  <property name="carManager" ref="carManager"/>
</bean>
  • a bean 'carManager' is created
  • it's used to initialize 'carManager' of CarListController.

We build (ant), relaunch Tomcat: http://localhost:8180/springmvc/list_cars.html

CarManager singleton for CarNewController

Do it by yourself, it's exactly the same. In the configuration file, use the CarManager instance you've already declared for '/new_car.html'.

CarManager

Since we now use a single instance of CarManager for our whole application, we don't need its carList attribute to be static anymore:

package springmvc.service;
 
import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;
 
import springmvc.model.Brand;
import springmvc.model.Car;
 
public class CarManager {
 
	private List<Car> carList;
 
	public CarManager() {
		Brand brand1 = new Brand();
		brand1.setId((long)1);
		brand1.setName("Mercedes");
		brand1.setCountry("Germany");		
 
		Brand brand2 = new Brand();
		brand2.setId((long)2);
		brand2.setName("Peugeot");
		brand2.setCountry("France");		
 
		Car car1 = new Car();
		car1.setId((long)1);
		car1.setBrand(brand1);
		car1.setModel("SL 500");
		car1.setPrice(new BigDecimal(40000));
 
		Car car2 = new Car();
		car2.setId((long)2);
		car2.setBrand(brand2);
		car2.setModel("607");
		car2.setPrice(new BigDecimal(35000));
 
		carList = new LinkedList<Car>();
		carList.add(car1);
		carList.add(car2);	
	}
 
	public List<Car> getCarList() {
		return carList;
	}	
 
	public Car createCar(Car c) {
		Car car = new Car();
		car.setId((long)carList.size() + 1);
		car.setBrand(c.getBrand());
		car.setModel(c.getModel());
		car.setPrice(c.getPrice());
 
		carList.add(car);
 
		return car;
	}
}

BrandManager

Let's do the same for BrandManager:

  • define an instance of BrandManager in the configuration file
  • use it for CarNewController (add a private attribute, remove instantiations)
  • make its brandList attribute not static

Externalize initialization code

We can go even further: initialize carList (CarManager) and brandList (BrandManager) in Spring configuration file:

    <bean id="carManager" class="springmvc.service.CarManager">
       <property name="carList">
         <list>
           <ref bean="car1"/>
           <ref bean="car2"/>
        </list>
        </property>
    </bean>    
 
    <bean id="brandManager" class="springmvc.service.BrandManager">
      <property name="brandList">
        <list>
          <ref bean="brand1"/>
          <ref bean="brand2"/>
        </list>
      </property>
    </bean>
 
    <bean id="brand1" class="springmvc.model.Brand">
        <property name="id" value="1"/>
        <property name="name" value="Mercedes"/>
        <property name="country" value="Germany"/>
    </bean>
 
    <bean id="brand2" class="springmvc.model.Brand">
        <property name="id" value="2"/>
        <property name="name" value="Peugeot"/>
        <property name="country" value="France"/>
    </bean>
 
    <bean id="car1" class="springmvc.model.Car">
        <property name="id" value="1"/>
        <property name="brand" ref="brand1"/>
        <property name="model" value="SL 500"/>
        <property name="price" value="40000"/>
    </bean>
 
    <bean id="car2" class="springmvc.model.Car">
        <property name="id" value="2"/>
        <property name="brand" ref="brand2"/>
        <property name="model" value="607"/>
        <property name="price" value="35000"/>
    </bean>
  • we define brands
  • we define cars using the brands
  • we initialize CarManager and BrandManager lists
  • notice the difference between the 'value' attribute, where you put a primary type and 'ref', where you give a bean name.

To make it work, we just need to add a setter method for CarManager and BrandManager's lists and remove the now useless initialization code. In 'WEB-INF/src/springmvc/service/BrandManager.java':

package springmvc.service;
 
import java.util.List;
 
import springmvc.model.Brand;
 
public class BrandManager {
 
	private List<Brand> brandList;
 
	public List<Brand> getBrandList() {
		return brandList;
	}	
 
	public void setBrandList(List<Brand> brandList) {
		this.brandList = brandList;
	}
 
	public Brand getBrandById(Long id) {
		for (Brand brand : brandList) {
			if (brand.getId().equals(id))
				return brand;
		}
		return null;
	}
}

In 'WEB-INF/src/springmvc/service/CarManager.java':

package springmvc.service;
 
import java.util.List;
 
import springmvc.model.Car;
 
public class CarManager {
 
	private List<Car> carList;
 
	public List<Car> getCarList() {
		return carList;
	}	
 
	public void setCarList(List<Car> carList) {
		this.carList = carList;
	}
 
	public Car createCar(Car c) {
		Car car = new Car();
		car.setId((long)carList.size() + 1);
		car.setBrand(c.getBrand());
		car.setModel(c.getModel());
		car.setPrice(c.getPrice());
 
		carList.add(car);
 
		return car;
	}
}

Much cleaner, isn't it? :-)

We rebuild (ant), relaunch Tomcat: http://localhost:8180/springmvc/list_cars.html

Everything should still work.. You can download the project here.


Previous: Form Validation --- Up: Spring Fast Tutorial

 

Feedback

Really true and wonderful 1 Hr. work tutorial. Keep it. Cheers.
ravi
Jun 14, 2008
#1
this is what I am looking for.Really explained spring in easiest way.Is there ne tutorial like this for hibernate?
jaydit chitre
Jul 17, 2008
#2
Quick and useful. Thanks
Sharmila
Jul 23, 2008
#3
Thanks a ton!!... you should be a teacher ;)
Paps
Jul 31, 2008
#4
More useful and quick learning. Thanks
Murali Krishna Mallam
Aug 2, 2008
#5
very nice tutorial. a great starting point, thanks.
brian
Aug 3, 2008
#6
i follow spring step by step tutorial but this one is kinda simple...so use of interface is optional for IoC, and anyone have encountered this problem? Neither BindingResult nor plain target object for bean name 'command' available as request...
bryan
Aug 6, 2008
#7
It is Very helpful tutorial..Thanks for sharing
Aks
Aug 19, 2008
#8
it's very very very nice example
mohan
Aug 20, 2008
#9
It is very nice tutorial for beginners... Thanks.
JJ
Aug 22, 2008
#10
Thanks for a really simple and fun tutorial :-) Just one thing. I had to change the uri for the jstl taglib for the jsps - From - <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> To - <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
Shreekant
Aug 29, 2008
#11
This is a great tutorial. I can say the best tutorial I saw on the web. I really appreciate your effort.
JB
Sep 12, 2008
#12
Super tutorial. Thx
Selvedin
Sep 25, 2008
#13
I have to agree with others that this tutorial is very useful. Thank you very much.
Jan
Sep 26, 2008
#14
i'm really glad to see such a nice,easy and introductry tutorial.i found the tutorial usufel and helpfull. it would be nice if there would be another tutorial which covers AOP, (JSF + STRUTS+ SPRING). i hope im not asking too much
DMX
Oct 14, 2008
#15
Awesome.. Pretty good tutorial, which shows the power of Springs IOC. Thank You
Lak
Oct 16, 2008
#16
Great Tutorial! really helped me, to get an idea of spring. Thx
Markus
Oct 24, 2008
#17
Wonderful tutorial....very useful for guys who are new to spring frame work.... thanks alot.
sree
Nov 11, 2008
#18
Very precise and covering full implementation of spring frame. Great work. I expect more. If you please show integration with Hibernate.
Ratnesh
Nov 18, 2008
#19
Really too good... Earlier I was not knowing even ABC of Spring... After this I have quit a good knowledge of Spring MVC flow.
Praveen
Nov 21, 2008
#20
Nice!!!!! Thanks
Chetan
Dec 1, 2008
#21
Really fantastic
Abdul
Dec 1, 2008
#22
Really awesome, material was very succint
Rad
Jan 6, 2009
#23
Thanks, Great tutorial for newcomer to spring-mvc module.
Anant
Jan 7, 2009
#24
Great Job, I really appreciate it since it give me very well understanding of how to build and how it works. Really Really Great Tutorial!!!
awayyout
Jan 21, 2009
#25
simple and great.. thanks a lot..
Siri
Jan 22, 2009
#26
Thanks for this great tutorial Jérome! Outstanding!!
Carlos
Feb 8, 2009
#27
Simply Superb, Great Job and Thanks alot!
Kala...
Mar 20, 2009
#28
that's all i can want from tutorial.
mehdi
Mar 24, 2009
#29
Thank you so much for this! this is like an epiphany article amongst all others. is there something like this for spring-hibernate? thanks again
leithold
Mar 30, 2009
#30
its Really superb. Thank U Very Very Much.
Dhaval Vekaria
Apr 10, 2009
#31
Me too joining the club. Pretty simple,nice and clear tutorial for Spring MVC for starters
Rohit
Apr 15, 2009
#32
Big hand to you, Sir! I'm a Spring newbie and this tutorial put me right back on track. Respect!
Ville
Apr 19, 2009
#33
Its really a good one to understand what spring does and mainly what Dependency injection is. Thanks to the Author.
Dhami
Apr 21, 2009
#34
Good work, thanks!
Boden
Apr 21, 2009
#35
nice tutorial
shishir saxena
May 6, 2009
#36
Indeed this is a wonderful and neat explained tutorial
mma
May 6, 2009
#37
very use full information for spring begineers,if it is possible provide advance spring example.
venkanna india
May 14, 2009
#38
You have explained spring in way that any one can easily understand it. Thanks, Tejash <a href="http://technical-tejash.blogspot.com">Technical Details By Tejash</a>
Tejash
May 15, 2009
#39
Great job !! Keep it up !!!!
Praveen
May 17, 2009
#40
Awesome tutorial .. keeps simple things simple .. the way i like it :)
srimal
May 19, 2009
#41
Exexllent work
nav
May 19, 2009
#42
Its very easy to understand for the begineers, thanks very much
Kish
May 28, 2009
#43
Simple and neat
Nitin
May 31, 2009
#44
Thanks - this is exactly what you need as the first step into any new technology.
Barry
Jun 11, 2009
#45
Good one
tt
Jun 12, 2009
#46
yey!
er
Jun 12, 2009
#47
This is wonderful tutorial all the way...
Murthy
Jun 22, 2009
#48
Bravo !!! Magnifico !!! Merci !!!
Paco
Jun 23, 2009
#49
Thanks...this helps me a lot
Piyush
Jun 26, 2009
#50
Really Nice...:)
Spring lover
Jul 8, 2009
#51
Yeah its Great...
Nitin Sindhwani
Jul 13, 2009
#52
Indeed great work which helped me to get started with Spring
Ajay Sahani
Jul 14, 2009
#53
The best for beginners....Thanks a lot
Jagruti
Jul 18, 2009
#54
Maybe better than the official Spring sample ! Is help me understand how to use the -servlet.xml file and how to configure the form beans. Very helpful sample, great job.
sangoman
Jul 21, 2009
#55
Great work Buddy...Thank a lot
Srinivas
Jul 21, 2009
#56
Hmm wt to say but this "Excellent Job dude".As requested by many, plz gift us a tutorial on hibernate also...Expecting it soon :P
mac
Jul 23, 2009
#57
Just the right tutorial for a programmer having kids in tow! Good work!
http://economics-science-life.blogspot.com/
Jul 25, 2009
#58
very good material

Jul 30, 2009
#59
This tutorial is called "Simply Superb...!"
Bobby
Aug 4, 2009
#60
good stuff. easy to follow but very informative
whistler
Aug 11, 2009
#61
certainly the fastest and most understandable tutorial available on the internet!
Shashank Araokar
Aug 13, 2009
#62
Short and sweet and to the point. Thanks a lot for putting this up.
Rex
Aug 14, 2009
#63
very good tutorial
sindhu
Aug 17, 2009
#64
nice one
punitha
Aug 17, 2009
#65
Is fantastic one,I have admired the way of presentation,Thanks a lot,for provide this material,I hope this should very very useful to all kinds of folks.We are expecting more.. will you ?
Sriranjani
Aug 19, 2009
#66
very good one.can u just have one more wid hibernate..i know u can do it very easily :)
Swapnil
Aug 20, 2009
#67
Thanks a lot.. This was very very helpful. In fact was just going thru this tutorial and got a very nice nice insight of the flow used in Spring MVC. Keep posting such nice and simple tutorials.
Sai Saran
Aug 21, 2009
#68
very good one.
chhaya
Aug 26, 2009
#69
Excellent! Very useful
vivek
Aug 31, 2009
#70
Excellent Work. If you know MVC. If you have worked on any MVC frameworks like struts... this is all you need to get to know Spring MVC. Good job.
Kanu_D
Sep 1, 2009
#71
nice one those who know spring before it will be an nice example to brush up.... nice work keep it up...
Elayaraja.D
Sep 2, 2009
#72
Thanks, excellent work. Best tutorial I have ever seen. If you can write a book with the same clarity and simplicity, you'll be a rock start in Java and Spring!
Rolf
Sep 2, 2009
#73
^^ that would be a "rock start" ... sorry for typo!
Rolf
Sep 2, 2009
#74
^^ um, rock star ... rock star ... rock star ... DOH! (autocorrect???)
Rolf
Sep 2, 2009
#75
Thanks a lot for putting this up. I wish I could also put something so clear and so helpful thing. Thanks a lot once again.
Ajay
Sep 11, 2009
#76
A+ :)

Sep 17, 2009
#77
Wow gr8 command..
Ashutosh
Oct 6, 2009
#78
Very Good and precise tutorial
Avneesh Saini, Noida
Oct 6, 2009
#79
good tutorial
Subash
Oct 9, 2009
#80
Simple and Good
Kiran Rayilla
Oct 11, 2009
#81
Very ... very super good!!! The best tutorial for spring_WEB_mvc! Do you have this for Portlet spring_PORTLET_mvc ? (Becuase nowaday WebPortal/Porlet-Application is in comming!)
x123
Oct 16, 2009
#82
very good tutorial. Explained in east steps. And best thing is that the code works too :)).
kaushik666
Oct 21, 2009
#83
U should put for DAO & Transaction Mgmt. anyways thanks for this...

Nov 1, 2009
#84
Its very crispy and altogether useful--good piece of work.
anand
Nov 5, 2009
#85
No confusions. Crystal clear tutorial. An example to other online tutorials. To the point explanation. First of all, the (simple)directory structure should be explained instead of giving vague explanations/definitions. You did it.
sridhar dhantu
Nov 10, 2009
#86
Extremely useful.

Nov 12, 2009
#87
Fantastic job.

Nov 12, 2009
#88
Excellent Work. Really Fast and very Clean. Thanks.
PC
Nov 12, 2009
#89
Superb!!!..Excellent work...very useful tutorial for beginners
shamel..palli
Nov 21, 2009
#90
Usefull one. Thanks to the Creator.
Venkatesh
Nov 23, 2009
#91
Thanks a lot. Very useful and easy to understand. It'll be nice if you can explain the code further.
Eurocenter
Nov 24, 2009
#92
good tutorial...
anutwalidera
Dec 2, 2009
#93
Thank you It's the best tutorial i ever read !!!! Thank you Mr really
sabri boubaker
Dec 15, 2009
#94
Best tutorial for Spring...

Dec 16, 2009
#95
Thank you so much! Would have never been able to grasp SpringMVC without this. Excellent work, mate.
binarycodes
Dec 17, 2009
#96
Thanks,,it's very superb....
Budi Syidiq
Dec 18, 2009
#97
awesome
Harish
Dec 22, 2009
#98
Thanks, Great tutorial for newcomer to spring-mvc module.
Ravi Varnapoora
Dec 28, 2009
#99
Very precise and covering full implementation of spring frame. Great work. I expect more. If you please show integration with Hibernate.
Sibi Varnapoora
Dec 28, 2009
#100
Excellent tutorial with good explanation on IoC
Radha
Jan 7, 2010
#101
Well prepared and excellent one.
Rajan
Jan 9, 2010
#102
thanks a lot for giving a excellent doc for spring.
anand
Jan 12, 2010
#103
Simply Great!
Jay
Jan 12, 2010
#104
Its a great job, done simply.
Swap
Jan 18, 2010
#105
Thanks for this. The final permissions I ended up setting to get out of trouble were:
        grant codeBase "file:/projects/java/spikes/springmvc/-" {
       permission java.lang.RuntimePermission "getClassLoader";
       permission java.lang.RuntimePermission "accessDeclaredMembers";
};

   
Anders Thøgersen
Jan 19, 2010
#106
Adipoli
Manoj
Jan 24, 2010
#107
Nice tutorial for the beginners. Good work keep going . . .
Karthik Dhamodharan
Feb 1, 2010
#108
Nice tutorial for the beginners. Good work keep going . . .
Karthik Dhamodharan
Feb 1, 2010
#109
Nice tutorial for the beginners. Good work keep going . . .
Karthik Dhamodharan
Feb 1, 2010
#110
Nice tutorial for the beginners. Good work keep going . . .
Karthik Dhamodharan
Feb 1, 2010
#111
I always end up having one or the other problem with the tutorials. This tutorial stands out. Many thanks for providing this.
Mahadev Semwal
Feb 1, 2010
#112
Great
Rama
Feb 15, 2010
#113
Great job
Bonzo
Feb 16, 2010
#114
Very simple and understandable tutorial for beginners. Thanks for sharing it :)

Could you also share it with annotation also? That would be great!
irfan
Feb 20, 2010
#115
Very good tutorial. It helped me lot. Thanks.
Anil
Feb 22, 2010
#116
Thanks for the crisp tutorial.
Subhash
Feb 26, 2010
#117
Nice tutorial!!!!! Thanks
Narender
Feb 26, 2010
#118
Excellent Tutorial.....This tutorial very useful to learn spring frame work easily.
RAJULA
Feb 28, 2010
#119
Nice one! This is all I needed!
Dips
Mar 5, 2010
#120
Excellent Tutorial.....This tutorial very useful to learn spring framework in less time
tvbapat
Mar 11, 2010
#121
Simple very simple => easy to understand => get effective result
Phalkun
Mar 12, 2010
#122
I feel good now. Thanks for your tutorial :)

Ramesh
Mar 19, 2010
#123
Wonderful........... with this tutorial SpringFramework become easy to me!!! Thanks Dude!!!
Syam
Mar 21, 2010
#124
Dear Author,

It just takes a genius to understand its simplicity.You took away complexity with in spring MVC and made it sound so simple and achievable.

Thanks a lot for making all of us understand mvc framework in just few slides.

Awesome work!

Now newbie like me can code mvc too.

Kind Regards

Neeraj Yadav
Mar 22, 2010
#125
Clear and concise. Brilliant!

You da man!!!
Robert I
Mar 23, 2010
#126
A very good tutorial for kick starting spring journey.
thanks a lot!!
cj
Mar 24, 2010
#127
Thanks a tone for shareing such kind of help!!!!

Vinod Kumar<::>
Mar 25, 2010
#128
Fantastice. !! Easy and Practical!!.. Many Thanks
Peliz
Mar 28, 2010
#129
great work and easy to understand. Thanks.
Deena
Apr 6, 2010
#130
Wonderful tutorial. I have been working with Spring for couple of months, could understand the basics very well with this.

thanks
Shivani
Apr 6, 2010
#131
i understand little can anybody tell me how to practice this in linux
suresh
Apr 7, 2010
#132
Excellent Tutorial. Clearly explained for beginners. Cheers!
Ramya
Apr 12, 2010
#133
+1
shiva
Apr 22, 2010
#134
Nice work, thanks.
Hessie
May 3, 2010
#135
excellent tutorial, easy to understand :)
Neha Jain
May 4, 2010
#136
Really useful
Elio
May 9, 2010
#137
Very good tutorial.
Deepshikha
May 11, 2010
#138
Really good to have a general idea as soon as possible. Thanks!
calgarra
May 14, 2010
#139
Excellent. God bless you.
Isaac
May 16, 2010
#140
Thanks a lot - Bests Regards

May 18, 2010
#141
Very Good tutorial

I am planning to take a session on Spring MVC to my counterparts and this is a nice approach.
Reflex
May 20, 2010
#142
One of the very best tutorial for the Springs framework..Cheers!!!!!
Venkatraman
May 24, 2010
#143
Pretty awesome!! Done a great job, its really supportive to learn about the concepts in spirng MVC
Suresh
Jun 1, 2010
#144
superb.. esay to understand..
siva kannan
Jun 2, 2010
#145
good and simple thank you , if you put advanced tutorial will be very nice . Saebnajim
Saebnajim
Jun 4, 2010
#146
Wow, thank you so much! I'm finally beginning to understand Spring's dependency injection. I've seen too many other tutorials that try to explain it with about 1000 lines of code and ended up confusing the hell out of me. But yours is better than most, probably because it doesn't introduce a lot of unnecessary classes.
Dummy Dude
Jun 4, 2010
#147
Wow, thank you so much. It is really great!!!
sofpast
Jun 10, 2010
#148
great tutorial, thanks a lot!!!
Tom Myer
Jun 10, 2010
#149
Very Simple. Very Nice and easy hassle-free learning- From long time i was looking for something like this. Thanks.
Venki
Jun 16, 2010
#150
Thanks for your great tutorial!
Tony
Jun 18, 2010
#151
Thanks .......

Jun 21, 2010
#152
Thanks Jerome....great tutorial.......Explained Spring in minimum time.....
Arun Mathews
Jun 22, 2010
#153
This is very helpful for the beginners. Thank you sharing it.
Dinesh Lomte
Jun 29, 2010
#154
Thank you for this very simple, neat, & clean tutorial.
Anurag Patil
Jul 1, 2010
#155
I have been successful in completing this tutorial without much fuss in Eclipse Helios.
Anurag Patil
Jul 1, 2010
#156
Thank for sharing it...
May God Bless U....
santosh
Jul 2, 2010
#157
Thanks a Lot
Nilesh Patil
Jul 2, 2010
#158
This is most effient and clear way of Tutorial, and let us see the skeleton of Spring and Tomcat config

Jul 10, 2010
#159
thanks
jack
Jul 22, 2010
#160
Excellent work, greatly helped
Suena
Jul 22, 2010
#161
Awesome!!! Thanks
Ballu
Jul 22, 2010
#162
I though that Spring was difficult but checking your tutorial I realized that in fact it is very similar to struts.

Great work !!!
Miguelin
Jul 23, 2010
#163
Awesome tutorial. This was my first Spring tutorial but it feels like I have read half a book.
Abul Fayes
Jul 24, 2010
#164
Very good tutorial - very well structured. Having the dowloadable code and the screenshots of the directory was a big help because you can track down where you might have missed a file. Thanks for taking the time.
Chris Ward
Jul 27, 2010
#165
very gud one.Thank's a lot :)
pranay
Jul 29, 2010
#166
very nice.he done good job
vijay ravilla
Aug 3, 2010
#167
Good :)
Govardhan
Aug 5, 2010
#168
great work to make it simple to understand.
shobhan
Aug 5, 2010
#169
Thank you verry much man ...great
Nikolay Nikolov
Aug 10, 2010
#170
Thank you verry much man
yamin
Aug 17, 2010
#171
Simple and easy one to understand for Spring
Rahul
Aug 17, 2010
#172
Very intuitive, thanks!
Tilemahos
Aug 26, 2010
#173
Perfect : thx !
Knice
Aug 29, 2010
#174
Great tutorial. I learned a lot. Thanks :-)
Ronin
Aug 30, 2010
#175
Greate. Thanks for this tutorial
Subramanyam B
Aug 31, 2010
#176
Real good for start up's..superb
Abhishek Chauhan
Aug 31, 2010
#177
really good tutorial for beginners
john
Sep 1, 2010
#178
great.
MK
Sep 2, 2010
#179
Went through your all Spring tutorials. They were so great. Thank you so much.
Nuwan Chamara
Sep 4, 2010
#180
Your great boss...
santhosh
Sep 7, 2010
#181
Thank you for these Spring Tutorials! It's direct to the core point, and now I know how to get into Spring fast.

I'll check out your other tutorials.

Your tutorials are well-organized, and well-formatted, too.
thenonhacker
Sep 15, 2010
#182
I love it and it is easy to understand. It helps me much and I am waiting for advance topic.
Deen
Sep 16, 2010
#183
Very Thank I had been looking for the easy example for long time.
Absolutely, You give me the easiest one in the world.

ZengCode
Sep 17, 2010
#184
I loved the tutorial - it was simple and sweet and for the most part great for beginners.

But will the dependency injection example on this last page work with simultaneous users?

The managers are singletons and share a list of cars that users can concurrently view and modify. Wouln't this would cause concurrency issues if it were ever used in a real production environment with multiple simultaneous users?
Chris Delia
Sep 23, 2010
#185
The totorial is really worth, Easy to understand.
Thanks a lot.
Shital
Oct 4, 2010
#186
Wonderful!!!
Sree
Oct 7, 2010
#187
Save me a lot of time, appreciate your time and your work.
Jason Xu
Oct 8, 2010
#188
Many thanks for providing such a crispy and concise tutorial.
anand
Oct 13, 2010
#189
An awesome tutorial
Prashanth
Oct 15, 2010
#190
Superb!. You should write a book. Really helpfull tutorial. Nice work.
PJ
Oct 15, 2010
#191
very very good,I am looking for this, thank you very much.
DinhSa
Oct 18, 2010
#192
Very useful. Thanks
Sanjeev Kumar Dangi
Oct 23, 2010
#193
Thanks for this tutorial. Sometimes it's hard to know how to start with Java technologies...
JL
Oct 25, 2010
#194
really a great tutorial for the beginners in spring mvc . thanks
Bala
Oct 27, 2010
#195
Thanks a lot, really helpful
Waseem
Oct 30, 2010
#196
Wow Itz just took one day to understand the Spring.
Nisa
Nov 9, 2010
#197
Great,....! its helpful for beginners like me.
Shia (FRF)
Nov 17, 2010
#198
really very good....
vss
Nov 18, 2010
#199
Chokran jazilane. Thanks a lot !. Merci Beaucoup!. Choukriya!. Grassiess !. Good work.
Hicham
Nov 22, 2010
#200
Nice tutorial !! Now I actually understood what's happening in my framework. :) Thanks.
Abhay
Nov 26, 2010
#201
Great...tks for share ;)
Marceliino on Rakas
Nov 26, 2010
#202
Great tutorial :-)

http://mikolajkania.info/
miki
Dec 9, 2010
#203
Nice tutorial..
This is really good.
jplans
Dec 10, 2010
#204
Thanks for such nice tutorial.
JavaGuy
Dec 17, 2010
#205
Cheers man, very good tuto !
Happy New Year !
micmx
Dec 31, 2010
#206
Thanks for this clear and very useful tutorial. It has helped me getting a snapshot of what Spring MVC can offer, and I must say it looks really good. Congratulations!
joanlofe
Jan 3, 2011
#207
thnx u so much. it helped me a lot..
dilmad
Jan 7, 2011
#208
Great tuto for beginners to learn SPRING MVC
chenna
Jan 19, 2011
#209
Thanks Jérôme Jaglale. I was looking for a nice, simple and fast to learn Spring MVC tutorial. This one is marvelous.
Regrads
Imran
http://www.imrantariq.com/blog/
Imran Tariq
Jan 27, 2011
#210
thanks thanks thanks.......
pooja
Jan 27, 2011
#211
bravo
djyooo
Jan 31, 2011
#212
I just download.
Thank a lot.
Sajith
Feb 8, 2011
#213
I have always procrastinated learning Spring MVC thinking it needs very verbose configuration. But this tutorial changed my perception. Very nice wotk and to the point. Thanks much.
Srinivas
Feb 9, 2011
#214
Wonderful tutorial....

Feb 10, 2011
#215
thanks
Pol
Feb 10, 2011
#216
Esto esta genial!!
siplive
Feb 14, 2011
#217
Great startup for beginers!
bharat
Feb 18, 2011
#218
Nice and easy , thanks
mazin
Mar 3, 2011
#219
very nice, Thanks. it helped.

Mar 9, 2011
#220
C'est le meilleur example que j'ai trouvé aujourd'hui, merci beaucoup!!!!!

???????!
Lancelot du Lac ??????
Mar 16, 2011
#221
the list of comment is bigger than this guide, and yet the guide id complete (and so all the comment are positive).
Thanks a lot for a great tutorial!!!
Kris
Mar 18, 2011
#222
muito bom !!
C'est super !!
Great !!
Emerson
Apr 11, 2011
#223
muito bom !!
C'est super !!
Great !!
Emerson
Apr 11, 2011
#224
The best

Apr 18, 2011
#225
Probably the best course i've ever seen :)
thank you very much !
Kamal Tsar
Apr 19, 2011
#226
Thanks for the quick tutorial.. Good Work!!!
Arunan
Apr 26, 2011
#227
Awesome... Tutorial..! Thanks a ton for your efforts...!!! :)
Simplest of all I have ever seen...! :) A dumb guy like me could do it in a single attempt... :P
Within an hour the fear of Spring(as new) went away... !!! :)

Abhishek
Apr 29, 2011
#228
Really a great tutorial about spring in web i googled.
It gives nice flat form to explore.
Thanks a lot for sharing keep it up...
Sunil
May 3, 2011
#229
Awesome tutorial! Really easy to follow. Nice to see a tutorial that is geared for beginners. Thank you!
Dan
May 4, 2011
#230
Cheers man!
Luiz
May 4, 2011
#231
You are the Man!!!!! Excellent tutorial! My fear of Spring is gone!
ben
May 4, 2011
#232
Very understandable Example for SpringMVC for both like beginner and Experience.
Thanks,
Avashesh Mishra
May 5, 2011
#233
ok, that's it, i've bookmarked you :P
Marius Popescu
May 5, 2011
#234
Great tutorial mate.
el Corko
May 18, 2011
#235
Nice one mate!
Great tutorial!
Tim
May 26, 2011
#236
The best tutorial on Spring I've seen. Keep up the great work!!!
Justin Case
Jun 1, 2011
#237
Sweet
Ayhan
Jun 10, 2011
#238
very good
cloud
Jun 12, 2011
#239
Good work
butt
Jun 13, 2011
#240
superb
Prad
Jun 14, 2011
#241
It is Good ,Thank you It's the best tutorial i ever read !!!! Thank you Mr really..............
Srinivasan.R
Jun 17, 2011
#242
it is very useful to bignners.realy gud..
venkataswamy tallapelly
Jun 18, 2011
#243
I love it!!
Andy
Jun 20, 2011
#244
really very much helpfull and informative
akash
Jun 22, 2011
#245
<bean id="carManager" class="springmvc.service.CarManager"/> does not work. Instead it should be

<bean name="carManager" class="springmvc.service.CarManager"/>
Raj
Jul 6, 2011
#246
Great tutorial. thanks. :)
aslon
Jul 11, 2011
#247
ya i also agree.This is a nice tutorial.Thank you very much.
swathi
Jul 12, 2011
#248
I got amazed, is what i was looking for!!! thank's!
Juanma
Jul 21, 2011
#249
Great Tutorial! Hope you could also provide an advance topic on your next post.

Kampai! =)
bon
Jul 26, 2011
#250
Thank you so much for this excellent tutorial! It helped me tremendously!
Thanh
Jul 27, 2011
#251
awesome!!! tutorial!!
sk
Jul 28, 2011
#252
Seriously good stuff here man, I learned a lot. thank you.
Rhinocerous
Jul 28, 2011
#253
It's really amazing , where a new programmer can learn very easily and quickly about the concept exactly!!!!!

Thanks a Lot!!!
uttam chandu
Aug 4, 2011
#254
Good work ... really nice tutorial for spring mvc beginners
mani
Aug 4, 2011
#255
Excellent tutorial! Thank you very much.

Aug 4, 2011
#256
super man! excellent tutorial.......
would be appreciated if you could add any of the persistent layer buddy! :)
thanku very much!....
ShivaGanesh
Aug 25, 2011
#257
Excellent tutorial! Thank you
sindhu
Aug 27, 2011
#258
Good Tutorial thank..
Very nicely explained
Tau
Sep 9, 2011
#259
Good Tutorial thank..
Very nicely explained
Taufique Shaikh
Sep 9, 2011
#260
Awesome tutorial, learned much more than I did when I tried to read other Spring Beginner guides. Thanks a lot for your contribution.
J. Cabrera
Sep 12, 2011
#261
They say "Even the most complicated thing can be explained in a simple way". Your tutorial is perfect example. Thanks!
Leo
Sep 20, 2011
#262
Clear and brief explanation with exact examples.
Great tutorial and the great person who made the tutorial.

Sep 21, 2011
#263
good 4 beginners,nice work....
chary
Sep 26, 2011
#264
Great tutorial. Thanks
Can you show how to connect to database in spring MVC?
tunp
Oct 8, 2011
#265
Great Work!
Singapore
Oct 10, 2011
#266
Great!
Cenk
Oct 10, 2011
#267
Gud
Ravi
Oct 12, 2011
#268
Great one!
Boris
Oct 13, 2011
#269
nice tutorial for beginners.
Guest
Oct 13, 2011
#270
Best one
SK
Oct 16, 2011
#271
Awesome...good job
immi
Oct 18, 2011
#272
Very very cool, one of the greatest introductions to a framework ever!
Bubba
Oct 19, 2011
#273
Followed other tutorial but this is the most useful - I now really love SPRING...now we just need a Hibernate followup :)
return;
javaBeaner
Nov 2, 2011
#274
super cool tutorial.. loved it..
shreesh
Nov 3, 2011
#275
Simple and Clear, this is what any newbie needs to start :)
IM
Nov 8, 2011
#276
Great work .. Easy to follow and understand . kindly update the same with hibernate which may be very useful.
yogesh
Nov 11, 2011
#277
very effective... nice tutorial.
Manish
Nov 17, 2011
#278
Really wonderful and great
Anik
Nov 21, 2011
#279
All these Spring tutorials you have written are well presented and really accelerate the learning process. Kudos!
Code Mung Key
Nov 21, 2011
#280
Thank you a lot! Your tutorials are amazing. I've just finished the last spring mvc tutorial. They are really simple and effective. That's what one need while making first steps in learning spring mvc. Please - make more java tutorials. Thanks!
Hassan al-Ammori
Dec 10, 2011
#281
Thank you for your heroic effort to create this fantastic tutorial for Spring beginners. I have to create web application using Spring, and this tutorial really makes me get into Spring fast. I deeply appreciate it.
Spring Beginner
Dec 14, 2011
#282
thank you for this it's really very good tutorial ..........................
worker
Dec 20, 2011
#283
Superb Explanation for Beginners...
Malar
Jan 9, 2012
#284
Awesome tutorial to start with Spring....
Bena
Jan 11, 2012
#285
You make rocket science look like an alphabet class.
steve
Jan 13, 2012
#286
VERY GOOD
SUBHASH
Jan 18, 2012
#287
superb
best tutorial
kick start to spring framework
sweta
Jan 19, 2012
#288
nice
subbu
Jan 25, 2012
#289
Well done sir!
AtliB
Jan 26, 2012
#290
Excellent Tutorial. Gets anyone off the ground quickly. Shows how the various features of Spring MVC can be used. Well done.
shodz
Jan 28, 2012
#291
very gud
subha
Jan 30, 2012
#292
You are the best. Period.
VR
Feb 1, 2012
#293
its looking good.thanks.
ashish
Feb 15, 2012
#294
Great intro to dependency injection with Spring. Thanks!
TK
Feb 16, 2012
#295
I was worried how to start, i'm not anymore. Thanks a lot!
me
Feb 24, 2012
#296
Good clear tutorial. Would like to see some annotation spring stuff!
Rob
Mar 8, 2012
#297
amaaazaaing tutes........ thanks,
what about autowiring and other new technology adapted by spring to avoid that sucha a suck xml conf?
reza
Mar 20, 2012
#298
very nice
India
Mar 22, 2012
#299
good clear quick start tutorial. Very nice.
AP
Mar 28, 2012
#300
Excellent tutorial...
Satpal
Apr 2, 2012
#301
super|
pp
Apr 2, 2012
#302
xvxdfd
dev
Apr 3, 2012
#303
excellent spring tutorials. i have a good handle on spring mvc now.
sean
Apr 8, 2012
#304
vevery nice
dhanu
Apr 17, 2012
#305
Awesome, thanks for the time and effort!!!
Ace
May 12, 2012
#306
quick clear and simple !!thks for effort !
Imad
May 21, 2012
#307
good tutorial!!!!!!!!!!!!!!!!!!!!!!!!
siddu
May 28, 2012
#308
well explained. thanks
Ayaz
Jun 4, 2012
#309
simple and great.. thanks a lot..
surendra
Jun 11, 2012
#310
very good tutorial to make conception clear at the beginning
learner of spring framwork
Jun 17, 2012
#311
Nice tutorial...
Siva prasad
Jul 15, 2012
#312
Excelente Tutorial.. al principio me costo un poco la estructura del proyecto pero al realizar unos cambios en el springmvc-servlet funciona correctamente.

Muchas gracias por el aporte...!!!
Ivan Manoatl
Jul 22, 2012
#313
This is best example in my knowledge..thanks buddy
haijitu
Jul 30, 2012
#314
Awesome sir!!
Rengarajan
Aug 8, 2012
#315
Awsome job, keep up the good work dude!

peace!
Diego
Oct 11, 2012
#316
Amazing Injection!!! Amazing Tutorial!!! No Nonsence.
Sree_Ramesh
Oct 24, 2012
#317
Thanks, Jérôme
Igor
Oct 29, 2012
#318
Thank you very much
Casir
Nov 12, 2012
#319
thanx! nice job!
pkovas
Jan 30, 2013
#320
I just want to say "THANK YOU"... I have been looking for simple Spring tutorial and could find any good one for beginner like myself.
Thanks
Yannick
Mar 14, 2013
#321
Great workout to begin... keep this good work... :)
Sankar C
Apr 3, 2013
#322
Good tutorial...........
chandu
May 1, 2013
#323
Very nice, Good learning Stuff and precisely what explained how to do the steps. Any one can do and learn
KP
May 10, 2013
#324
muy bueno Gracias!!
Em
May 14, 2013
#325