Get all updates of Java4s
Follow Us: Email Newsletter

Quick Steps To Developing Spring Applications – Don’t Miss

Spring » On Aug 5, 2011 { 30 Comments } By Sivateja

We will see the steps to be follow for developing any spring application, these are core level read carefully.

  • Spring environment starts by loading spring configuration xml file into Resource Interface object, we call this loading process as bootstrapping (technically) of spring framework.
  • Resource is an interface and ClassPathResource is an implemented class given by spring, both are given in *


Resource res = new ClassPathResource(“Our Config xml file name”);

  • Actually this configuration file contains all bean configurations about our application [ some thing like struts.xml in struts 2 ]
  • Next step is to bring spring IOC container into our program, it will be created by reading configuration xml through Resource object. Spring IOC container is called BeanFactory and this container is responsible for creating the bean objects and for injecting it’s dependencies through out our applications.
  • BeanFactory is the interface and XmlBeanFactory is an implementation class of it, BeanFactory given in org.springframework.beans.factory. * and XmlBeanFactory is given in org.springframework.beans.factory.xml.* pack


BeanFactory factory = new XmlBeanFactory(res);
// given above Resource object…

Now you can get required object from spring container by calling getBean() method, while calling this method we need to pass the bean id as a parameter like.. getBean(bean id), and this method always returns Object class object and we need to type caste this into our bean type.


Object ob = factory.getBean(“id1″);
FirstBean fb = (FirstBean)ob;

Now you can call what ever you want from the object fb.

You Might Also Like

  ♦ About Author ♦

Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.


30 Responses to “Quick Steps To Developing Spring Applications – Don’t Miss”
  1. Abhishek says:

    No words are enough to appreciate :-) :-)

  2. Java4s says:


    Thank you :-)

  3. Shital says:


  4. sai says:

    really great tutorials.. no words to say..

  5. jitendra singh says:

    Really great tutorials till now…………….!

  6. Sonu says:

    Really an Awsm tutorial i ever seen…!!

  7. kirthika says:

    nice explanation… Very helpful to the beginners like me.

  8. ravikiran says:

    good explanation…

  9. Kishor says:

    Nice Explanation… Very much helpful for beginners.. keep it up.

    Thank you very much Sivateja Kandula.

  10. Trilochan Tarai says:

    really… what a nice explanation. i knew lots of concepts…

  11. Korivi says:

    Very good self Explanatory.
    Thanks for providing such a valuble content.
    Keep it up.

  12. ramu says:

    really great tutorials….Thank you very much

  13. praveen kumar says:

    Nice Explanation… Very much helpful for beginners..

  14. Supriyo Das says:

    This is what I was looking for. A very clean and sharp explanation.
    Thanks a lot.

  15. Anil says:

    Hi Sir i just started reading your tutorials and i felt very happy because i understand everything wat ever you explainned…………….

  16. hemanth says:

    Simple and very good explanation… Thank you so much

  17. sarronya says:

    Very understandable to a junior developer… Thanks

  18. Sachin says:

    Very Good Explanation…

  19. akki says:

    thank u sir,for spring explanation in simple words

  20. Rajesh says:

    very nice explanation.It really helps me to understand the concept of spring.

  21. Somu says:

    good explanation for beginers..

  22. koti says:

    very nice explanation.It really helps me to understand the concept of spring.

  23. sarala says:

    Very good explanation thanks a lot…its very helpful for beginners

  24. Ishwar says:

    Nice explaination

  25. Nageshwar says:

    Nice, Quick understanding

  26. Swamy says:

    Thanks for sharing your knowledge

  27. sreenu says:

    sir u helped to students like god……..

  28. sreenivas says:

    very nice sir………….


By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful Links Current & UpComing Tutorials
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2016 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.