Hello world Example in Spring 4

In this tutorial we will learn how to create a simple hello world example in Spring 4.1.

Technologies used in this article :

1. Spring 4.1.0
2. Maven 1.4
3. Eclipse 4.2
4. JDK 1.6
5. Spring IDE

1. Add Spring 4.1 Dependencies to the project

Please add the Spring 4.1 dependencies like as in below Maven’s pom.xml file.

 2. Implement Spring bean class

Write a Spring bean class with sayHello metod like below.

 3. Configuration of bean class.

Configure the bean HelloWorld in bean.xml file like as below.

4. Project Structure in Eclipse.

hello world example in spring

 

 

 

 

 

 

 

 

 

 

5. Run the test program.

 

 

OUT PUT:

 

Download  Source Code

 

Posted in Spring.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">