Springboot
Springboot
Springboot
Spring Boot automatically scans all the components included in the project by using @ComponentScan
annotation.
6. Can we disable the default web server in the Spring boot application?
Yes, we can use application.properties to configure the web application type i.e spring.main.web-
application-type=none.
//use of exclude
@EnableAutoConfiguration(exclude={className})
11. What is the difference between @RestController and @Controller in Spring Boot?
@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 XML.
To make this easy and clean, Spring has the provision of Profiles to keep the separate configuration of
environments.
SPRINGBOOT
13. What is Spring Actuator? What are its advantages?
An actuator is an additional feature of Spring that helps you to monitor and manage your application
when you push it to production. These actuators include auditing, health, CPU usage, HTTP hits, and
metric gathering, and many more that are automatically applied to your application.
14. What are the actuator-provided endpoints used for monitoring the Spring boot application?
Actuators provide below pre-defined endpoints to monitor our application -
Health
Info
Beans
Mappings
Configprops
Httptrace
Heapdump
Threaddump
Shutdown
Simply put, this allows for loose coupling of components and moves the responsibility of managing
components onto the container.