Spring Objective Questions and Answers

Test and improve your knowledge of the Spring Framework with expertly curated MCQs covering IoC, Dependency Injection, Bean lifecycle, annotations, AOP, Spring JDBC, transactions, and Spring MVC. Perfect for Spring interviews, backend developers, and Java professionals aiming to strengthen their framework fundamentals.

Practice Spring MCQs with Detailed Explanations

Answer at least 12 questions to submit.

16.
Which of the following is correct about dependency injection?

A - It helps in decoupling application objects from each other.

B - It helps in deciding the dependencies of objects.

C - It stores objects states in database.

D - It stores object states in file system.
17.
What is Advice?
18.
What is a DispatcherServlet?
19.
What are the ways to access Hibernate by using Spring?
20.
What is global-session scope?
21.
Which of the among is not a special bean in WebApplicationContext?
22.
What could not return a Spring MVC controller ?
23.
Where do you cannot declare Spring MVC controller?
A. In a Spring application context XML configuration file
B. Into the web.xml file of the web application
C. Into the java code by using annotations
D. Into the JSP pages
24.
How the spring DispatcherServlet supports for returning the last-modification-date ,as specified by Servlet API?
25.
Which of these statement is false regarding the given handlerMappings?
26.
Which handlerMappings are being used by default if no  handlerMapping beans are found?
27.
Which is not a view in Spring Web Flow?
28.
What is ContextStartedEvent event?
29.
Which is not a MethodNameResolver ?
30.
How could you externalize constants from a Spring configuration file or a Spring annotation into a .properties file?
Answered: 0 / 15