Sei sulla pagina 1di 2

0)how many type of containers in Spring ?

=> Core container (Bean Factory) => Application Container (ApplicationContext) Differences b/w above two ------------------------------------ApplicationContext BeanFactory --------------------------------Here we can have more than one config files possible In this only one config file or .xml file Application contexts can publish events to beans that are registered as listeners Support internationalization (I18N) messages Support application lifecycle events, and validation. Support many enterprise services such JNDI access, Doesn't support. It's not Doesn't support. Doesn't support.

1) What are the Core container module and Application context module? ANS: Core Container Module: This module is the fundamental module of spring framework. For a spring-based application, BeanFactory is the core. The Spring framework was developed on top of this module............. 2)What is the default scope of a spring bean? Ans) SingleTon 2.1) what is Singleton and Prototype ? Singleton: means single bean definition to a single object instance per Spring IoC container. Prototype: means a single bean definition to any number of object instances. Read more: http://javarevisited.blogspot.com/2011/09/spring-interviewquestions-answers-j2ee.html#ixzz1zq9KoL5N 3) what are the diff type's of injuctions in SPRING ? => setter injuction => constructor injuction

4) which injuction is better(setter or constructor) ? Ans) setter

5) why constructor is not bettere ? Ans) if use constructor injuction there may be a chance of geting ambiguos injction exception 5) how to make the spring bean to non single ton ? Ans) by using property called prototype 6) what is IOC ? asn) IOC (Inversion Of Controle) injucting dependies into dependent beans is called IOC. 7) what is DI ? ans) Physical realization of IOC is DI(dependency injuction) 8) What are different modules in spring? Ans: spring have seven core modules The Core container module Application context module AOP module (Aspect Oriented Programming) JDBC abstraction and DAO module O/R mapping integration module (Object/Relational) Web module MVC framework module 9) What are different bean scopes available to configure? Following scopes can be assigned to different beans. - singleton: One bean instance per IoC container - prototype: Any number of instances of bean - request: Within HTTPRequest object scope - session: As long as HttpSession is alive - globalsession: Within life-cycle of global HttpSession. Applicable in portlet context usually. 10) What is default scope in Spring? Ans) Singleton. 11) Tell me an adavntage of spring ? Ans) light weight container.

Potrebbero piacerti anche