Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

Spring, Servlet web project Integration approaches


i was reading about
Spring, Servlet web project Integration approaches
Approach 1:
         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.

Approach 2:
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
ASKER CERTIFIED SOLUTION
Avatar of Am P
Am P
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial