1) What type of dependency injection does Spring NOT support? Interface injection
Constructor injection
Setter injection
2) Which of the following is not a valid method to provide configuration metadata to a Spring Container? By marshalling & unmarshalling the objects
XML based configuration file
Java-based configuration
3) @RequestMapping is part of which part of Spring? Web MVC
Web
Security
4) What is one of the major improvements in Spring 3? more annotations are supported
more bean scopes are supported
additional lifecycle methods were added
5) Which annotation lets you grab the value of an HTTP request header? @RequestHeader
@Header
@HttpHeader
6) Which of the following is NOT a JDBC statement? Interim Statement
Callable Statement
Regular Statement
7) How is slf4j commonly used in Spring applications? as the logging framework
as the JDBC provider
as a bean
8) Which of the following is NOT a scope available in Spring web applications? instance
Singleton
Session
9) spring-test uses what common convention to allow testing using HTTP session and HTTP request objects? Mock objects
MVC
Open-closed principle
10) What property can be used to set the active Spring profiles Spring.profiles.active
Active.spring.profiles
Active.profile
11) What is bean scope? Bean scope forces Spring to produce a new bean instance as per the scope defined.
Bean scope defines the accessibility of bean in a java class.
Bean scope defines the accessibility of bean in a java package
12) Which of the following attribute is used to handle web flow requests? servlet-mapping
servlet-attr
servlet-flow
13) Which of the following RestTemplate method is used to consume restfull service with post method? postForObject
getForRest
getForObject
14) We use Spring __________ to consume an API using all the main HTTP Verbs. RestTemplate
JdbcTemplate
MainTemplate
15) Which of the following is not related to JdbcTemplate? ObjectMapper
RowMapper
ResultSetExtractor
16) Which of the following is not correct about using JdbcTemplate in spring? Spring JdbcTemplate works only for NoSQL databases
JdbcTemplate helps to clean-up the resources automatically
Spring JdbcTemplate offers several convenient resources to query the database
17) Which of the following is not the spring built-in events? ResponseHandledEvent
ContextStartedEvent
ContextRefreshedEvent
18) ______ annotation indicates that the class can be used by the Spring IoC container as a source of bean definitions. @Configuration
@Bean
@Service
19) Which annotation in spring indicates that the affected bean property must be populated in XML configuration file at configuration time else the container will throw a BeanInitializationException exception? @Required
@Autowired
@Qualifier
20) Which of the following is not a spring bean autowire mode? autoModeOn
Constructor
byName
21) In spring collection injection, _________ can be used to inject a collection of name-value pairs where the name and value are both Strings. Props
map
HashTable
22) In spring xml-based configuration, constructor injection is acheived using __________ attribute constructor-arg
Constructor
const-arg
23) In spring XML-based configuration metadata, we indicate a child bean definition by using the _________ attribute. parent
master
inherited
24) Full form of pojo is ____________ plain old java object
pure old java object
plain on java object
25) Bean factories is defined by ____________ org.springframework.beans.factory.BeanFactory
org.springframework.beans.api.BeanFactory
org.springframework.api.factory.BeanFactory
26) Which annotation is used to indicate spring that autowiring should be performed? @Autowired
@Autoscan
@Wired
27) Which of the following is correct? ApplicationContext extends BeanFactory
ApplicationContext implements BeanFactory
BeanFactory extends ApplicationContext
28) The process of applying aspects to a target object to create a new proxied object is called____________ weaving
point cuts
AspectJ
29) Which of the following scope doesn't only apply to web-applications in spring? prototype
Request
Session
30) @Component annotation on class indicates that a bean should be created for the class
that a bean should not be created for the class
that autowiring should be enabled for the class
31) ClassPathXmlApplicationContext searches .xml file in: anywhere in classpath (including jar file)
anywhere in project path (including jar file)
specific location within filesystem
32) @componentScan("tihApplications") in spring indicates tihApplications is the base package that needs to be scanned for components
tihApplications is the base package that needs to be created for components
tihApplications is the component name
33) core, beans, context, expression, context support in spring are all part of: Core Spring Container module
AOP module
Web and Remoting module
34) In Spring based applications, the objects lives in spring container
spring pool
spring group
35) Spring helps to acheive: loose coupling and easy to test applications
tight coupling and easy to test applications
mixed coupling and easy to test applications
36) Partial dependency in spring can be achieved using: Setter injection
Constructor injection
AOP
37) This loads bean definitions and wire them together_________ application context
context
AOP
38) What pattern does Spring MVC implement to delegate request processing to controllers? Front Controller
Facade
Reactive Chain
39) Which exception class is bound to all the exceptions thrown in Spring applications? DataAccessException
ArrayIndexOutofBound
NullPointerException
40) What are the different types of Bean injection? constructor and setter
constructor and getter
getter and setter
41) What types of dependency injection does Spring support? Based on the constructor and setters
Based on the constructor, setters, and getters
Based on setters, getters, and properties
42) What is dependency injection? It is a design pattern that implements the Inversion of control (IoC) pattern for software applications.
It is one of the Spring modules.
It is a technique to get dependencies from any project.
43) Which Of The Following Is Not A Spring Module? HTML/JSP
AOP
O/R Integration
44) Dependency Injection Or IOC Is A _____________? Design Pattern
Framework
Java Module
45) Controller In Spring Is A(N)_______________? interface
concrete class
abstract class
46) Spring Is A ___________ Framework? Open source
free
proprietary
47) Endpoint Classes for DOM:- AbstractDomPayloadEndpoint
AbstractJDomPayloadEndpoint
AbstractDom4jPayloadEndpoint
48) Spring-WS provides various abstract endpoint classes for you to process the request. org.springframework.ws.server.endpoint
org.springframework.ws.server
org.springframework.*
49) In Spring, which of the following about the scope of a stateful bean is correct? Singleton scope
Prototype scope
Singleton and prototype scope
50) In Spring, which of the following is the correct way for using idref attribute? Setter method and Constructor argument
Constructor argument
Setter method
51) Which of the following is the classification of different autowire in Spring? byName, byType, constructor, and autodetect
byName, byType, destructor, and autodetect
byName, byMethod, constructor, and autodetect
52) The act of creating associations between different component of application is known as: wiring
integrating
collaborating
53) The objects that form the backbone of your application and that are managed by the Spring container are called bean
Application
context
54) The Spring container gets its instructions on what objects to instantiate, configure, and assemble by reading the configuration metadata
spring integration data
source code
55) Method provided by ExectuorService which returns a Future < T > submit
publish
addService
56) Which package is used for periodic work java.util.TimerTask
java.lang.Thread
java.util.concurrent
57) Method that converts string into a property value setAsText
getAsText
regText
58) Method which converts property into a string value getAsText
setAsText
regText
59) Which of the following property editors are registered by Spring? FileEditor
CustomNumberEditor
CustomDateEditor
60) Which property editor is used to specify a URL String for a property of the URL type? java.net.URL
java.io.*
java.net.*
61) Which of the following is used to convert property values to text Values? property Editor
property setter
property getter
62) Which event is provoked when web request comes into action RequestHandledEvent
ContextClosedEvent
ContextStoppedEvent
63) Which method is used to publish your own custom event publishEvent
contextPublish
applicationEventPublish
64) Which interface is used to listen to certain events ApplicationListener
ContextListener
EventListener
65) Which interface defines methods for resolving text messages MessageSource
ApplicationListener
ApplicationContextListener
66) Which bean factory post processor externalizes part of the bean configurations into a properties file PropertyPlaceholderConfigurer
PropertyPlaceholderRegister
PropertyGetPath
67) PathCheckingBeanPostProcessor will not work properly in case of:- JSR Annotation
XML Configuration
Java based Configuration
68) Which method of bean post processors is used to check path existence getPath
setPath
Value
69) Which method is used to register BeanPostProcessor? addBeanPostProcessors
registerBeanPostProcessors
addBeanProcessors
70) Alternate way of destruction method is:- destroy-method attribute
afterPropertiesSet
init-method attribute
71) Alternate way of initialization method is:- init-method attribute
afterPropertiesSet
destroy-method attribute
72) Which Attribute is used to specify the bean declared? factory-bean
scope
getBean
73) Exception thrown by factory method? BeanCreationException
IllegalArgumentException
IndexOutofBoundException
74) Which attribute is used to specify static factory-method? factory-method
default-init method
destroy method
75) Which of the following method can be used to used to instantiate a method? static factory method
default-init method
destroy method
76) Which attribute is used to specify class name of the bean? class
name
id
77) Beans can be created by which of the following properties? It’s own constructor
scope
Property
78) To declare a JNDI object reference in the Spring IoC container. JndiObjectFactoryBean
JndiObject
JndiObjectFactory
79) Annotation which decorates the PostageServiceBean is @Interceptors
@Wire
@Mention
80) To start the OpenEJB container, you first set environment variable OPENEJB_HOME
EJB 2.x components
EJB_HOME
81) Spring EJB Support Classes for Different Types of EJB AbstractStatefulSessionBean
stateless session beans (SLSBs)
message-driven beans (MDBs)
82) Spring EJB Support Classes for Different Types of EJB AbstractStatefulSessionBean
stateful session beans (SFSBs)
message-driven beans (MDBs)
83) In Spring Method that allows you to start a new transaction is called - getTransaction()
commit()
rollback()
84) How many types of method injection are available in spring? 2
8
4
85) Which element is used to specify access attributes for bean's methods. security:protect
security:intercept
security:intercept-security
86) Which method is used to process bean before initialization callback postProcessBeforeInitialization()
postProcessAfterInitialization()
scope
87) What is the scope of bean in portlet context? global-session
Session
Request
88) Spring is developed by Pivotal Software
Red Hat Software
Daniel Fernández
89) Spring is licensed under Apache License 2.0
GNU Lesser General Public License
Open source
90) In AOP, the job of an aspect is called___________ advice
join-points
point-cut
91) To deal with the databases, spring framework provides______________ JdbcTemplate
JdbcPluggins
JdbcDrivers
92) Which tag is also allowed by static field? util:constant
Set
List
93) What is Bean in Spring? Object
Container
component
94) What is the default scope of the beans? Singleton
Session
Request
95) Which of the following class can be used to execute Sql queries in spring? JdbcTemplate
DBTemplate
DBHelper
96) Which class is used to map a database row to a java object in spring? RowMapper
ResultSetMapper
RowSetMapper
97) Thread scoped bean is introduced in which version of spring framework. 3.0
2.0
1.0
98) Which of the following is part of Data Access layer in Spring framework? JMS
Aspects
Beans
99) Which of the following class can be used to call Stored Procedures in spring? SimpleJdbcCall
JdbcTemplate
JdbcTemplateCall
100) How to handle shut down of IoC container? Using registerShutdownHook()
Using registerHook()
Using shutdownHandler()
101) What is session scope? This scopes a bean definition to an HTTP session.
This scopes the bean definition to Spring IoC container.
This scopes the bean definition to HTTP request.