i was reading about
Spring, Servlet web project Integration approaches
Create web project then add spring capablities by making sure applicationContext.xml file is in WEB-INF folder. Then Create servlet program. Configure dao to access the database.Introduce spring container by Creating singleton class of ApplicationContext as it should be started only once as all beans should be available to servlets.
ServletContext object is created per application as a singleton object.When ServletContext object is created, listeners are invoked.
configure Spring container which is started when application is started which depends on your ServletContext listener by Saving instance of ApplicationContext in ServletContext object as attribute
I would liek to know which approach is better which one we use where, advantages, disadvantages of each one. I was not clear on this concept. thanks in advance