Spring Framework Interview Questions Flashcards
What is Spring Framework?
https://training.javatpoint.com/important-features-of-spring-framework
Features of Spring Framework
https://training.javatpoint.com/important-features-of-spring-framework
What is a Spring Configuration File?
https://www.careerride.com/Spring-configuration-file.aspx#google_vignette
Question 3 from
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/
Spring – Understanding Inversion of Control with Example
https://www.geeksforgeeks.org/spring-understanding-inversion-of-control-with-example/
What do you understand by Dependency Injection?
https://www.geeksforgeeks.org/spring-dependency-injection-with-example/
Explain the difference between constructor and setter injection?
https://www.geeksforgeeks.org/spring-dependency-injection-with-example/
What are Spring Beans?
https://stackoverflow.com/questions/17193365/what-in-the-world-are-spring-beans/17193458#17193458
How is the configuration meta data provided to the spring container?
https://www.freetimelearning.com/software-interview-questions-and-answers.php?How-is-the-configuration-meta-data-provided-to-the-spring-container?&id=2164
How is the configuration meta data provided to the spring container?
https://www.freetimelearning.com/software-interview-questions-and-answers.php?How-is-the-configuration-meta-data-provided-to-the-spring-container?&id=2164
What are the bean scopes available in Spring?
https://www.tutorialspoint.com/spring/spring_bean_scopes.htm
Question 25 from
https://www.turing.com/interview-questions/spring-boot
Explain Bean life cycle in Spring Bean Factory Container.
https://www.edureka.co/community/17617/bean-life-cycle-in-spring-bean-factory-container
Question 10 from
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
What do you understand by Bean Wiring.
https://www.quora.com/What-is-bean-wiring-in-Spring-in-Java
What is autowiring and name the different modes of it?
https://www.geeksforgeeks.org/spring-autowiring/
What are the limitations of autowiring?
Question 13
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
What is Springboot
https://www.tutorialspoint.com/spring_boot/spring_boot_introduction.htm
Springboot interview question no 1
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
Explain the advantages of using Spring Boot for application development.
Spring Boot helps to create stand-alone applications which can be started using java.jar (Doesn’t require configuring WAR files).
Spring Boot also offers pinpointed ‘started’ POMs to Maven configuration.
Has provision to embed Undertow, Tomcat, Jetty, or other web servers directly.
Auto-Configuration: Provides a way to automatically configure an application based on the dependencies present on the classpath.
Spring Boot was developed with the intention of lessening the lines of code.
It offers production-ready support like monitoring and apps developed using spring boot are easier to launch.
Differentiate between Spring and Spring Boot.
https://www.geeksforgeeks.org/difference-between-spring-and-spring-boot/
Intermediate Question 1 from
https://www.turing.com/interview-questions/spring-boot
What are the features of Spring Boot?
https://docs.spring.io/spring-boot/docs/2.4.x/reference/html/spring-boot-features.html
https://www.interviewbit.com/spring-boot-interview-questions/
What does @SpringBootApplication annotation do internally?
https://www.linkedin.com/pulse/understanding-springbootapplication-annotation-spring-punyakeerthi-bl-z1u5c?utm_source=share&utm_medium=member_ios&utm_campaign=share_via
What are the effects of running Spring Boot Application as “Java Application”?
The application automatically launches the tomcat server as soon as it sees that we are running a web application
What is Spring Boot dependency management system?
https://www.geeksforgeeks.org/spring-boot-dependency-management/#:~:text=Dependency%20is%20nothing%20but%20a,dependencies%20supremely%20easy%20for%20us.
What are the possible sources of external configuration?
Spring Boot allows the developers to run the same application in different environments by making use of its feature of external configuration. This uses environment variables, properties files, command-line arguments, YAML files, and system properties to mention the required configuration properties for its corresponding environments. Following are the sources of external configuration:
Command-line properties – Spring Boot provides support for command-line arguments and converts these arguments to properties and then adds them to the set of environment properties.
Application Properties – By default, Spring Boot searches for the application properties file or its YAML file in the current directory of the application, classpath root, or config directory to load the properties.
Profile-specific properties – Properties are loaded from the application-{profile}.properties file or its YAML file. This file resides in the same location as that of the non-specific property files and the {profile} placeholder refers to an active profile or an environment.
Question 9 from
https://www.turing.com/interview-questions/spring-boot
Can we change the default port of the embedded Tomcat server in Spring boot?
Yes, we can change it by using the application properties file by adding a property of server.port and assigning it to any port you wish to.
For example, if you want the port to be 8081, then you have to mention server.port=8081. Once the port number is mentioned, the application properties file will be automatically loaded by Spring Boot and the specified configurations will be applied to the application.
Can you tell how to exclude any package without using the basePackages filter?
We can use the exclude attribute while using the annotation @SpringBootApplication as follows:
@SpringBootApplication(exclude= {Student.class})
public class InterviewBitAppConfiguration {}
Can the default web server in the Spring Boot application be disabled?
Yes! application.properties is used to configure the web application type, by mentioning spring.main.web-application-type=none.
What are the uses of @RequestMapping and @RestController annotations in Spring Boot?
Springboot interview question no 13
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
What is Spring AOP and it’s terminology?
https://www.geeksforgeeks.org/aspect-oriented-programming-and-aop-in-spring-framework/
What is an advice? Explain its types in spring.
https://www.tutorialspoint.com/springaop/springaop_advice_types.htm
https://docs.spring.io/spring-framework/reference/core/aop/ataspectj/advice.html
https://www.baeldung.com/spring-aop-advice-tutorial
Question 24 from
https://www.javatpoint.com/spring-interview-questions
What is Spring AOP Proxy pattern?
https://www.dineshonjava.com/understanding-aop-proxies-chapter-31/
A proxy pattern is a well-used design pattern where a proxy is an object that looks like another object but adds special functionality to it behind the scenes.
Spring AOP follows proxy-based pattern and this is created by the AOP framework to implement the aspect contracts in runtime.
The standard JDK dynamic proxies are default AOP proxies that enables any interface(s) to be proxied. Spring AOP can also use CGLIB proxies that are required to proxy classes, rather than interfaces. In case a business object does not implement an interface, then CGLIB proxies are used by default.
What are some of the classes for Spring JDBC API?
https://www.geeksforgeeks.org/spring-jdbc-template/
Spring JDBC question 4
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
How can you fetch records by Spring JdbcTemplate?
Spring JDBC question 5
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
Question 15 from
https://www.javatpoint.com/spring-interview-questions
What is the Spring MVC framework?
https://www.geeksforgeeks.org/spring-mvc-framework/
SpringMVC framework question 1
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
What are the benefits of Spring MVC framework over other MVC frameworks?
https://www.upgrad.com/blog/spring-mvc-flow-diagram/#:~:text=Fast%20development%3A%20The%20MVC%20spring,for%20application%20and%20framework%20classes.
What is DispatcherServlet in Spring MVC? In other words, can you explain the Spring MVC architecture?
https://www.geeksforgeeks.org/spring-mvc-framework/
What is a View Resolver pattern and explain its significance in Spring MVC?
https://www.geeksforgeeks.org/viewresolver-in-spring-mvc/
What is the @Controller annotation used for?
https://www.geeksforgeeks.org/spring-controller-annotation-with-example/
What is the @Controller annotation used for?
https://www.geeksforgeeks.org/spring-controller-annotation-with-example/
When to use @controller and @restcontroller
https://stackoverflow.com/questions/72211755/when-to-use-controller-and-when-restcontroller-annotation-in-restapi-based-on#:~:text=%40Controller%20is%20used%20to%20annotate,expect%20from%20that%20particular%20endpoint.
@Controller Map of the model object to view or template and make it human readable but @RestController simply returns the object and object data is directly written in HTTP response as JSON or
Can you create a controller without using @Controller or @RestController annotations?
Yes! You can create a controller without @Controller or @RestController annotations by annotating the Spring MVC Controller classes using the @Component annotation. In this case, the real job of request mapping to handler method is done using the @RequestMapping annotation.
https://stackoverflow.com/questions/29410179/how-can-i-create-a-spring-controller-without-the-use-of-the-annotations
Yes, you can create a controller in Spring without using the @Controller or @RestController annotations. The @Controller and @RestController annotations are just convenience annotations that provide specific functionalities, but you can achieve the same functionality by using other annotations or configuration.
To create a controller without using @Controller or @RestController, you can use the following approach:
Implement the Controller Logic: Create a regular Java class that contains the logic for handling HTTP requests and generating responses.
Use Appropriate Annotations: Instead of @Controller or @RestController, you can use other annotations to specify the request mappings and the response type.
What is ContextLoaderListener and what does it do?
https://stackoverflow.com/questions/11815339/role-purpose-of-contextloaderlistener-in-spring
The ContextLoaderListener loads and creates the ApplicationContext, so a developer need not write explicit code to do create it. In short, it is a listener that aids to bootstrap Spring MVC.
The application context is where Spring bean resides. For a web application, there is a subclass called WebAppliationContext.
The lifecycle of the ApplicationContext is tied to the lifecycle of the ServletContext by using ContextLoaderListener. The ServletContext from the WebApplicationContext can be obtained using the getServletContext() method
What are the differences between @RequestParam and @PathVariable annotations?
https://medium.com/javarevisited/difference-between-requestparam-and-pathvariable-in-spring-mvc-873bd6330bce#:~:text=%40RequestParam%20captures%20values%20from%20the,slashes%20(%E2%80%9C%2F%E2%80%9D).
What is the Model in Spring MVC?
Model is a reference to have the data for rendering.
It is always created and passed to the view in Spring MVC. If a mapped controller method has Model as a parameter, then that model instance is automatically injected to that method.
Any attributes set on the injected model would be preserved and passed to the View.
In the context of Spring MVC, the term “Model” represents the data layer. It is a map (similar to a java.util.Map) that contains data to be rendered by the View. This data is typically the outcome of executing your business logic, which you want to show to the user.
What is the use of @Autowired annotation?
https://www.digitalocean.com/community/tutorials/spring-autowired-annotation#:~:text=Spring%20%40Autowired%20annotation%20is%20used,through%20spring%20bean%20configuration%20file.
What is the role of @ModelAttribute annotation?
The annotation plays a very important role in binding method parameters to the respective attribute that corresponds to a model. Then it reflects the same on the presentation page. The role of the annotation also depends on what the developer is using that for. In case, it is used at the method level, then that method is responsible for adding attributes to it. When used at a parameter level, it represents that the parameter value is meant to be retrieved from the model layer.
https://www.geeksforgeeks.org/spring-mvc-modelattribute-annotation-with-example/
The @ModelAttribute annotation in Spring MVC is used to bind method parameters or method return values to model attributes. It plays a crucial role in the Model-View-Controller (MVC) architecture, where it helps transfer data between the Controller and the View.
The key role of @ModelAttribute is to facilitate data transfer between the Controller and the View. It allows you to pre-populate form data when displaying forms to users and automatically bind user inputs to model attributes when processing form submissions. Additionally, it helps in adding common attributes (like reference data) to the model across multiple controller methods.
What is the importance of the web.xml in Spring MVC?
https://stackoverflow.com/questions/5837122/can-someone-explain-the-spring-web-xml-file
web.xml is also known as the Deployment Descriptor which has definitions of the servlets and their mappings, filters, and lifecycle listeners. It is also used for configuring the ContextLoaderListener. Whenever the application is deployed, a ContextLoaderListener instance is created by Servlet container which leads to a load of WebApplicationContext.
What are the types of Spring MVC Dependency Injection?
https://www.codingninjas.com/studio/library/spring-dependency-injection#:~:text=The%20different%20types%20of%20dependency%20injections%20in%20Spring%20are%20constructor,according%20to%20the%20different%20requirements.
What is the importance of session scope?
https://stackoverflow.com/questions/29413290/how-exactly-works-the-spring-session-scope-of-a-bean-what-is-the-default-scope
SpringMVC Interview question 14
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
What is the importance of @Required annotation?
https://www.linkedin.com/pulse/spring-boot-important-annotations-abid-anjum?utm_source=share&utm_medium=member_ios&utm_campaign=share_via
https://stackoverflow.com/questions/16769360/how-does-required-annotation-work-with-javaconfig
The annotation is used for indicating that the property of the bean should be populated via autowiring or any explicit value during the bean definition at the configuration time.
Differentiate between the @Autowired and the @Inject annotations.
Spring MVC Interview question 16
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
Are singleton beans thread-safe?
No, the singleton beans are not thread-safe because the concept of thread-safety essentially deals with the execution of the program and the singleton is simply a design pattern meant for the creation of objects. Thread safety nature of a bean depends on the nature of its implementation.
How can you achieve thread-safety in beans?
The thread safety can be achieved by changing the scope of the bean to request, session or prototype but at the cost of performance. This is purely based on the project requirements.
What is the significance of @Repository annotation?
@Repository annotation indicates that a component is used as the repository that acts as a means to store, search or retrieve data. These can be added to the DAO classes.
https://medium.com/@AlexanderObregon/understanding-the-role-of-the-repository-annotation-in-spring-data-access-95ec917c77b0#:~:text=The%20%40Repository%20annotation%20simplifies%20exception,thrown%20by%20the%20DAO%20layer.
How is the dispatcher servlet instantiated?
https://www.geeksforgeeks.org/what-is-dispatcher-servlet-in-spring/
The dispatcher servlet is instantiated by means of servlet containers such as Tomcat. The Dispatcher Servlet should be defined in web.xml The DispatcherServlet is instantiated by Servlet containers like Tomcat.
How is the root application context in Spring MVC loaded?
The root application context is loaded using the ContextLoaderListener that belongs to the entire application. Spring MVC allows instantiating multiple DispatcherServlet and each of them have multiple contexts specific to them. They can have the same root context too.
How does the Spring MVC flow look like? In other words, How does a DispatcherServlet know what Controller needs to be called when there is an incoming request to the Spring MVC?
A Dispatcher Servlet knows which controller to call by means of handler mappings. These mappings have the mapping between the controller and the requests. BeanNameUrlHandlerMapping and SimpleUrlHandlerMapping are the two most commonly used handler mappings.
BeanNameUrlHandlerMapping: When the URL request matches the bean name, the class corresponding to the bean definition is the actual controller that is responsible for processing the request.
SimpleUrlHandlerMapping: Here, the mapping is very explicit. The number of URLs can be specified here and each URL is associated explicitly with a controller.
If the Spring MVC is configured using annotations, then @RequestMapping annotations are used for this purpose. The @RequestMapping annotation is configured by making use of the URI path, HTTP methods, query parameters, and the HTTP Headers.
Where does the access to the model from the view come from?
The view requires access to the model to render the output as the model contains the required data meant for rendering. The model is associated with the controller that processes the client requests and finally encapsulates the response into the Model object.
Why do we need BindingResults?
https://stackoverflow.com/questions/10413886/what-is-the-use-of-bindingresult-interface-in-spring-mvc#:~:text=%5B%20BindingResult%20%5D%20is%20Spring’s%20object%20that,object%20and%20throw%20an%20exception.
What are Spring Interceptors?
https://www.geeksforgeeks.org/spring-boot-interceptor/#:~:text=Spring%20Boot%20Interceptor%20is%20an,an%20incoming%20or%20outgoing%20request%E2%80%9D.
Is there any need to keepspring-mvc.jar on the classpath or is it already present as part of spring-core?
The spring-mv.jar does not belong to the spring-core. This means that the jar has to be included in the project’s classpath if we have to use the Spring MVC framework in our project. For Java applications, the spring-mvc.jar is placed inside /WEB-INF/lib folder.
The spring-mvc.jar file is not part of the spring-core library, and they serve different purposes.
spring-core: This is the core Spring framework, which provides fundamental parts of the framework such as dependency injection and inversion of control.
spring-webmvc: This is the Spring MVC framework (typically named as spring-webmvc.jar not spring-mvc.jar), which is built on top of the core Spring framework and provides Model-View-Controller (MVC) architecture for building web applications.
So, if you’re building an application using the Spring MVC framework, you would need both spring-core and spring-webmvc on your classpath. These libraries are usually managed by a build tool like Maven or Gradle, and are automatically included when you specify them as dependencies in your build file.
What are the differences between the <context:annotation-config> vs <context:component-scan> tags?</context:component-scan></context:annotation-config>
<context:annotation-config> is used for activating applied annotations in pre-registered beans in the application context. It also registers the beans defined in the config file and it scans the annotations within the beans and activates them.
The <context:component-scan> tag does the task of <context:annotation-config> along with scanning the packages and registering the beans in the application context.
<context:annotation-config> = Scan and activate annotations in pre-registered beans.
<context:component-scan> = Register Bean + Scan and activate annotations in package.
context:annotation-config>: This is used to activate various annotations within Spring-managed beans. For example, if you have beans that are manually defined in your XML file and these beans have annotations like @Autowired, @PostConstruct, @PreDestroy, @Resource, etc., you need <context:annotation-config> to activate these annotations. However, it does not automatically detect and instantiate beans from the classpath.
<context:component-scan>: This tag does everything that <context:annotation-config> does, but it goes one step further. It scans the classpath for classes annotated with @Component, @Service, @Repository, @Controller, etc., and automatically registers them as beans in the Spring application context. In other words, it automatically detects and instantiates your beans. So, when you use <context:component-scan>, you don’t need to explicitly define each bean in your XML configuration file, as long as they are annotated correctly and exist within the base-package specified by <context:component-scan>.
</context:component-scan></context:component-scan></context:annotation-config></context:component-scan></context:annotation-config></context:component-scan></context:annotation-config></context:annotation-config></context:component-scan></context:annotation-config>
How is the form data validation done in Spring Web MVC Framework?
Spring MVC interview question 28
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
Question 40 from
https://www.edureka.co/blog/interview-questions/spring-interview-questions/
How to get ServletConfig and ServletContext objects in spring bean?
This can be done by either implementing the spring-aware interfaces or by using the @Autowired annotation.
@Autowired
private ServletContext servletContext;
@Autowired
private ServletConfig servletConfig;
Question 19 from
https://www.baeldung.com/spring-interview-questions#Q17
Differentiate between a Bean Factory and an Application Context.
https://www.geeksforgeeks.org/spring-difference-between-beanfactory-and-applicationcontext/
Question 42 from
https://www.edureka.co/blog/interview-questions/spring-interview-questions/
How are i18n and localization supported in Spring MVC?
Spring MVC framework question 31
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
Internationalization (i18n) and localization (L10n) are important features for applications that need to support multiple languages or locales. In Spring MVC, these are supported using a combination of LocaleResolver, LocaleChangeInterceptor, and message source properties files.
What do you understand by MultipartResolver?
Spring MVC interview question 32
https://www.interviewbit.com/spring-interview-questions/?sign_up_medium=ib_article_auth_blocker/#
MultipartResolver is an interface defined in Spring MVC framework that is used for uploading files. When a form in a Spring web application is submitted and it has enctype=”multipart/form-data”, the MultipartResolver implementation handles the file upload part of the request.
The MultipartResolver is part of the Spring DispatcherServlet’s configuration, so you’ll define it in your Spring configuration.
How is it possible to use the Tomcat JNDI DataSource in the Spring applications?
To use the servlet container which is configured in the JNDI (Java Naming and Directory Interface) DataSource, the DataSource bean has to be configured in the spring bean config file and then injected into the beans as dependencies. Post this, the DataSource bean can be used for performing database operations by means of the JdbcTemplate. The syntax for registering a MySQL DataSource bean:
<bean>
<property></property>
</bean>
To use a Tomcat JNDI DataSource in a Spring application:
Setup DataSource in Tomcat: Configure the DataSource in Tomcat’s context.xml file with the necessary parameters (username, password, driverClassName, etc).
What will be the selection state of a checkbox input if the user first checks the checkbox and gets validation errors in other fields and then unchecks the checkbox after getting the errors?
The validation is generally performed during HTTP POST requests. During HTTP requests, if the state of the checkbox is unchecked, then HTTP includes the request parameter for the checkbox thereby not picking up the updated selection. This can be fixed by making use of a hidden form field that starts with _ in the Spring MVC.
Advantages of Spring Framework With Limitations
https://data-flair.training/blogs/advantages-of-spring/
What are the modules of spring framework?
https://docs.spring.io/spring-framework/docs/4.0.x/spring-framework-reference/html/overview.html
https://www.edureka.co/blog/interview-questions/spring-interview-questions/
Roles and types of IOC containers in spring
https://www.geeksforgeeks.org/spring-understanding-inversion-of-control-with-example/
In which scenario, you will use singleton and prototype scope?
Singleton scope should be used with EJB stateless session bean and prototype scope with EJB stateful session bean.
What is a stateless session bean
https://www.javatpoint.com/stateless-session-bean
Difference between stateless and state full
https://www.interviewbit.com/blog/stateful-vs-stateless/
What are the transaction management supports provided by spring?
https://www.tutorialspoint.com/spring/spring_transaction_management.htm#:~:text=Spring%20supports%20both%20programmatic%20and,need%20of%20an%20application%20server.
What are the advantages of JdbcTemplate in spring?
https://www.javatpoint.com/spring-JdbcTemplate-tutorial#:~:text=Advantage%20of%20Spring%20JdbcTemplate&text=Spring%20JdbcTemplate%20eliminates%20all%20the,lot%20of%20work%20and%20time.
Question 13 from
https://www.javatpoint.com/spring-interview-questions
What is the advantage of NamedParameterJdbcTemplate?
https://prateek-ashtikar512.medium.com/spring-jdbc-namedparameterjdbctemplate-2e7cd08c49e6
What is the advantage of SimpleJdbcTemplate?
https://docs.spring.io/spring-framework/docs/2.5.x/reference/jdbc.html#:~:text=SimpleJdbcTemplate%20%2D%20this%20class%20combines%20the,an%20easier%20to%20use%20API.
Question 17 from
https://www.javatpoint.com/spring-interview-questions
What are the advantages of spring AOP?
https://medium.com/@AlexanderObregon/cross-cutting-concerns-in-spring-microservices-with-aspect-oriented-programming-aop-de72c52e7639
https://www.jbktutorials.com/spring-aop/advantages-of-spring-aop.php#gsc.tab=0
What is JoinPoint?
https://docs.spring.io/spring-framework/docs/2.0.x/reference/aop.html#:~:text=Join%20point%3A%20A%20point%20during,always%20represents%20a%20method%20execution.
Does spring framework support all JoinPoints?
No, spring framework supports method execution joinpoint only.
What is Pointcut?
https://www.tutorialspoint.com/springaop/springaop_pointcut_methods1.htm
https://docs.spring.io/spring-framework/reference/core/aop/ataspectj/pointcuts.html
What is Aspect?
https://www.digitalocean.com/community/tutorials/spring-aop-example-tutorial-aspect-advice-pointcut-joinpoint-annotations#:~:text=Aspect%3A%20An%20aspect%20is%20a,as%20Aspect%20using%20%40Aspect%20annotation.
What is Introduction?
Introduction represents introduction of new fields and methods for a type.
What is target object?
https://stackoverflow.com/questions/56692011/what-is-a-target-object-in-spring-aop
What is weaving?
https://www.simplilearn.com/tutorials/spring-tutorial/spring-aop-aspect-oriented-programming#:~:text=Weaving%3A,normally%20performs%20weaving%20at%20runtime.
Does spring perform weaving at compile time?
No, spring framework performs weaving at runtime.
What are the AOP implementation?
There are 3 AOP implementation.
Spring AOP
Apache AspectJ
JBoss AOP
What is the front controller class of Spring MVC?
https://www.javatpoint.com/spring-mvc-tutorial#:~:text=Front%20Controller%20%2D%20In%20Spring%20Web,of%20the%20Spring%20MVC%20application.
https://www.geeksforgeeks.org/spring-mvc-framework/
Does spring MVC provide validation support?
https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-controller/ann-validation.html#:~:text=Spring%20MVC%20has%20built%2Din,support%20works%20on%20two%20levels.
Which Is the Best Way of Injecting Beans and Why?
The recommended approach is to use constructor arguments for mandatory dependencies and setters for optional ones. This is because constructor injection allows injecting values to immutable fields and makes testing easier.
What Is the Default Bean Scope in Spring Framework?
By default, a Spring Bean is initialized as a singleton.
What Does the Spring Bean Life Cycle Look Like?
Question 12 from
https://www.baeldung.com/spring-interview-questions#Q6
What Is the Spring Java-Based Configuration?
It’s one of the ways of configuring Spring-based applications in a type-safe manner. It’s an alternative to the XML-based configuration.
https://www.tutorialspoint.com/spring/spring_java_based_configuration.htm