Spring Flashcards
ApplicationContext will pre-instantiate beans with the ________ bean scope.
Select one:
a. Global Session
b. Singleton
c. Prototype
d. ApplicationContext never pre-instantiates beans
b. Singleton
How do you turn ON annotation support in Spring MVC? Select one: a. beans annotation-driven b. mvc annotation-driven c. mvc annotation-config d. context annotation-config
b. mvc annotation-driven
How do you turn ON annotation-based autowiring in Spring? Select one: a. context annotation-driven b. mvc annotation-driven c. beans annotation-driven d. context annotation-config
d. context annotation-config
What is the minimum number of beans needed in the xml file to integrate Spring and Hibernate assuming that you must use the xml to wire beans, and transaction management by Spring is required?
Select one:
a. 2
b. 3
c. 4
d. 1
b. 3
Hibernate Contextual Session Context Annotation-Config -Data Source -Hibernate Transaction Manager -Session Factory
My Contextual Session integration is not working! I have a setter for my SessionFactory in my DAO class to inject the SessionFactory. I wired my DataSource bean into the SessionFactory bean. I also wired the SessionFactory bean into the DAO bean. I annotated (Transactional) each CRUD method to a transaction in the DAO class and use the tag in appContext.xml.
Select one:
a. Contextual Sessions is a deprecated process. Just use Hibernate Template.
b. Create a TransactionManager bean and wire the DataSource bean into it.
c. Create a TransactionManager bean and wire the DAO bean into it.
d. Create a TransactionManager bean and wire the SessionFactory bean into it.
d. Create a TransactionManager bean and wire the SessionFactory bean into it.
Select the core component of the Spring MVC module.
Select one:
a. ActionServlet
b. FrontControllerServlet
c. Faces-Servlet
d. DispatcherServlet
d. DispatcherServlet
Select the following correct statement regarding Spring.
Select one:
a. Does not encourage tight coupling.
b. Does not have enough modules to be considered a true framework.
c. Does not allow for transaction management.
d. Does not allow for integration into an application at any point in development
e. Does not provide developers with vast amounts of community supported documentation.
a. Does not encourage tight coupling.
Select the incorrect annotation from the list.
Select one:
a. @Autowired
b. @Controller
c. @Transactional
d. @Component
e. @Dao
e. @Dao
Select the incorrect module of Spring
Select one:
a. Core
b. Data Source
c. Beans
d. Context
b. Data Source
The \_\_\_\_ takes the request and calls the appropriate service methods based on used GET or POST method. Select one: a. DispatcherServlet b. HandlerMapping c. Controller d. ViewResolver
c. Controller
The DispatcherServlet will take help from \_\_\_\_\_ to pickup the defined view for the request Select one: a. HandlerMapping b. DispatcherServlet c. Controller d. ViewResolver
d. ViewResolver
The Spring MVC DispatcherServlet consults the \_\_\_\_ to call the appropriate Controller. Select one: a. Controller b. HandlerMapping c. ViewResolver d. DispatcherServlet
b. HandlerMapping
The Spring Web MVC framework is designed around a \_\_\_\_\_ that handles all the HTTP requests and responses Select one: a. HandlerMapping b. DispatcherServlet c. Controller d. ViewResolver
b. DispatcherServlet
This annotation identifies the method as a request handler type for a given path. Select one: a. @Controller b. @RequestMapping c. @Handler d. @Path
b. @RequestMapping
This annotation registers the class as a controller and must be used in conjunction with tag in the XML to automatically discover and register the controllers as Spring beans. Select one: a. @Path b. @Controller c. @Handler d. @RequestMapping
b. @Controller
What are the different ways in which you can integrate Spring/Hibernate?
Select one:
a. HibernateTemplate, HibernateDaoSupport, ContextualSessions
b. JDBCTemplate, HibernateDaoSupport, ContextualSessions
c. HibernateTemplate, DelegatingActionProxy, ContextualSessions
d. HibernateTemplate, HibernateDaoSupport, TransactionManagement
a. HibernateTemplate, HibernateDaoSupport, ContextualSessions