==>>What is the front controller class of Spring MVC?
The DispatcherServlet class works as the front controller in Spring MVC.
==>> What does @Controller annotation?
The @Controller annotation marks the class as controller class. It is applied on
the class.
==>>What does @RequestMapping annotation?
The @RequestMapping annotation maps the request with the method. It is applied on
the method.
==>>What does the ViewResolver class?
The View Resolver class resolves the view component to be invoked for the request.
It defines prefix and suffix properties to resolve the view component.
==>>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 Difference Between BeanFactory and ApplicationContext?
BeanFactory is an interface representing a container that provides and manages bean
instances. The default implementation instantiates beans lazily when getBean() is
called.
In contrast, ApplicationContext is an interface representing a container holding
all information, metadata and beans in the application.
It also extends the BeanFactory interface, but the default implementation
instantiates beans eagerly when the application starts. However,
this behavior can be overridden for individual beans.
==>>What Is the Default Bean Scope in Spring Framework?
By default, a Spring Bean is initialized as a singleton.
==>> Name Some of the Design Patterns Used in the Spring Framework?
Singleton Pattern – singleton-scoped beans
Factory Pattern – Bean Factory classes
Prototype Pattern – prototype-scoped beans
Adapter Pattern – Spring Web and Spring MVC
Proxy Pattern – Spring Aspect-Oriented Programming support
Template Method Pattern – JdbcTemplate, HibernateTemplate, etc.
Front Controller – Spring MVC DispatcherServlet
Data Access Object – Spring DAO support
Model View Controller – Spring MVC